home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / util / shell / csh543mberndt.lha / csh.doc < prev    next >
Text File  |  1995-04-19  |  112KB  |  3,339 lines

  1.  
  2.         INSTRUCTIONS FOR C-SHELL VERSION: 5.43 (April 1995)
  3.         ===================================================
  4.  
  5.   Contents
  6.   --------
  7.  
  8.     O.    Installation
  9.     I.    Description
  10.     II.    Overview of major features
  11.     III.    Restrictions
  12.     IV.    Pipes
  13.     V.    Command Pre-processor
  14.     VI.    Command Line Editing
  15.     VII.    Function Keys
  16.     VIII.    Shell Commands
  17.     IX.    Special Set Variables
  18.     X.    Functions
  19.     XI.    Miscellaneous
  20.     XII.    Example source files
  21.     XIII.    Default values
  22.     XIV.    Object oriented features
  23.     XV.    Keymaps
  24.     XVI.    Scrolling
  25.  
  26.  
  27.  
  28. O.  Installation
  29. ----------------
  30.  
  31. This program requires at least AmigaOS 2.04 (KS37.175, WB37.67) or higher.
  32.  
  33. For  online  help  inside csh, assign CSH:  somewhere and put csh.doc there.
  34. Then  you can use the 'man' command for any desired command.  Press the HELP
  35. key for a command list.
  36.  
  37. You  can  simply  invoke  csh  from  the  command line or at the end of your
  38. startup-sequence,  because  csh is, from the AmigaDOS standpoint, not a true
  39. shell  like  l:shell-seg.   Nevertheless, csh is 'pure', so if your archiver
  40. forgot to set the 'p' bit, do it right now.
  41.  
  42. Proposed final setup:  If you want to make csh resident, do the following:
  43.  
  44.   1. Copy csh anywhere on your (hard)disk, e.g. dh1:tools
  45.   2. Make sure your s:startup-sequence contains:
  46.     resident dh1:tools/csh add
  47.     csh
  48.   4. In s:.login, put any commands to be called only once, like setmap,
  49.     assign, setclock. This is a shell script, use # for comments, and
  50.     don't use .key type commands.
  51.   5. In s:.cshrc, you put any commands that need to be executed on every
  52.     invocation, like 'alias', 'set' and so on.
  53.   6. Put the following to s:cli-startup and s:shell-startup, so csh will be
  54.     started in any window opened by NewCLI, NewShell or from workbench:
  55.         csh
  56.         endcli
  57.  
  58.  
  59. Additionally,  I  recommend  to assign CSH:  somewhere and put your docs and
  60. CShell scripts there.  You can do the assign from inside the shell, it's not
  61. needed at startup.
  62.  
  63. The file s:.cshrc is executed on every startup (of csh) if it exists,
  64. the file s:.login only on csh's first invocation after boot-time,
  65. the file s:.logout is executed on every termination (of csh).
  66.  
  67.  
  68.  
  69. I.  DESCRIPTION
  70. ---------------
  71.  
  72. This version of Shell is the successor of:
  73.     Shell V2.04 (C)Copyright 1986, Matthew Dillon, All Rights Reserved
  74.     Shell V2.04M-V2.07M by Steve Drew
  75.     Shell V2.08MI, V3.xxA and V4.xxA by Carlo Borreo & Cesare Dieni
  76.     Shell V5.xxL by U. Dominik Mueller
  77.     Shell V5.20+ by Andreas M. Kirchwitz
  78.  
  79.  
  80.  
  81. Responsible for the V5.20+ series of Cshell is:
  82.  
  83.     Andreas M. Kirchwitz
  84.     Seesener Str. 69
  85.     D-10709 Berlin
  86.     Germany
  87.  
  88.     UUCP/Internet: csh-fan@zikzak.in-berlin.de
  89.  
  90. Send wishes, detailed bug reports (and the beer bottles :) to the above
  91. address. Postcards welcome!
  92.  
  93. For bug reports, I need your Csh version number and a reproducable bug
  94. generation example.
  95.  
  96. If you report Enforcer hits please send the complete Enforcer and SegTracker
  97. output. Otherwise it's of no earthly use.
  98.  
  99. The V5.20+ series is an ARP-free, OS-2.x-only pre-6.0 version of Cshell.
  100. It only has an english ascii-doc, but it sweetens the time until Csh 6.x
  101. (by Urban Mueller) is available (whenever this might be ;-)
  102.  
  103. Please check the 'restrictions' chapter before reporting any bugs and add
  104. your CShell version and a description of your configuration.
  105.  
  106. You may distribute this program unmodified and for non-profit only.
  107.    *** YOU MAY NOT MODIFY THIS PROGRAM AND REDISTRIBUTE IT ***
  108. Please contact me if you want to make changes.
  109.  
  110.  
  111. AVAILABILITY
  112. ------------
  113.  
  114. CShell can always be downloaded at the AUGL BBS.  Some additionals parts
  115. (French documentation) are available there, too.
  116.  
  117. For those who want to get it per FIDO file request, the archive is always
  118. named like 'csh513.lzh' for CShell 5.13 and 'csh513s.lzh' for its source.
  119.  
  120. CShell is available via FTP from AmiNet ftp.wustl.edu (and mirrors) in the
  121. directory /pub/amiga/shell/ (the archive names are the same) and via E-Mail
  122. from "mail-server@cs.tu-berlin.de" in the same directory.
  123.  
  124.  
  125. CREDITS
  126. -------
  127.  
  128. Arexx is a program by William Hawes.
  129. Cygnus Ed Professional (C) 1988 CygnusSoft Software.
  130.  
  131. Thanks to:
  132.  
  133. Matt Dillon, Steve Drew, Calro Borreo and Cesare Dieni for the previous
  134. versions of Csh.
  135.  
  136. Ralph Babel, Eddy Carroll, Gary Duncan, Randell Jesup, Steve Koren, Tim
  137. MacKenzie, Axel Roebel, Mike Schwartz for their code contributions and
  138. suggestions.
  139.  
  140. Michael Beer, Carl Johan Block, Hubert Feyere, Magnus Heldestad, Carsten
  141. Heyl, Alex Liu, Declan McArdle, Svante Eriksson, Luke Mewburn, Peter Orbaek,
  142. Allard Siemelink, Roddi Walker, Shimon Weissman and the unknown Swedish guy
  143. who found the double-LF bug for their bug reports and feedback.
  144.  
  145. Roy Haverman, Martin Horneffer, Hans-Christian Huerlimann, Daniel Pfulg,
  146. Patrizio Rusconi, Christian Schneider and especially Markus Illenseer for
  147. the German translation of the doc.
  148.  
  149. Olivier Berger for the French translation of the doc.
  150.  
  151.  
  152. AMIGAGUIDE
  153. ----------
  154.  
  155.   AmigaGuide, AmigaGuide.info, amigaguide.library, WDisplay, WDisplay.info
  156.        (c) Copyright 1992 Commodore-Amiga, Inc.  All Rights Reserved.
  157.           Reproduced and distributed under license from Commodore.
  158.  
  159.        AMIGAGUIDE SOFTWARE IS PROVIDED "AS-IS" AND SUBJECT TO CHANGE;
  160.      NO WARRANTIES ARE MADE.  ALL USE IS AT YOUR OWN RISK.  NO LIABILITY
  161.                         OR RESPONSIBILITY IS ASSUMED.
  162.  
  163.  
  164. II. OVERVIEW
  165. ------------
  166.  
  167. Shell provides a convenient AmigaDos alternative command interface.  All its
  168. commands  are internal and thus it does not rely on the c:  commands for any
  169. functionality.
  170.  
  171. Major features include:
  172.     - freely programmable command line editing
  173.     - simple history
  174.     - piping
  175.     - aliases with arguments
  176.     - variables & variable handling (embedded variables)
  177.     - file name expansion via wild carding ('?', '*' and more)
  178.     - conditionals (if/else etc..)
  179.     - source files  (w/ gotos and labels)
  180.     - tab file name completion
  181.     - object oriented features (file classes, actions)
  182.     - many built in commands to speed things up
  183.     - full functionality on VT terminals
  184.  
  185. CShell runs on minimum stack, for recursive aliases and source files better
  186. increase stack to 10K or more.
  187.  
  188. If you use CShell for the first time, remember the following:
  189.     - CShell internal commands must be lowercase & can be abbreviated
  190.     - AmigaDOS command 'Execute' causes some trouble. You cannot
  191.       redirect it, you must not rename it, and you get no return code.
  192.       You can also use 'source' to start your scripts, but you'll have
  193.       to rewrite them a bit. Besides the '.key'-type commands, 'source'
  194.       is downward compatible with 'Execute'.
  195.     - You can always get more information on a command if csh.doc is
  196.       in the current directory or in csh: (you will be able to modify
  197.       this) and you enter 'man <command>'
  198.     - The wild card #? doesn't work. Use *
  199.        (#? only works if you "escape" it... better use * :-)
  200.  
  201.  
  202. III. RESTRICTIONS
  203. -----------------
  204.  
  205. The c:Execute command cannot be redirected, does not return error codes, and
  206. might cause other problems. It will not work at all if it has been renamed.
  207.  
  208. The  VDK: handler and Frank Seidel's BootRam-Handler have a bug with setting
  209. file  dates,  so  when  using  the copy command you should try the -d and -p
  210. switches, otherwise your file date will be bad. (This is not a shell bug)
  211.  
  212. If  using  it with conman you may consider starting shell with the -a switch
  213. to  turn  off  shell's  command line editing and use conmans instead. You'll
  214. lose, however, many shell features like file name completion.
  215.  
  216. CB-handler  (a tool that installs a scrollbar in the CLI window) is not 100%
  217. compatible  with  cshell.  The log will not always represent the real screen
  218. contents.
  219.  
  220. Don't  use  the  "Iconify" feature of KingCON (a CON-Handler replacement that
  221. gives  you  scrollbar  and  other  features in CLI windows). Don't ignore the
  222. warning,  KingCON  gives you when iconifying a Cshell window. This will crash
  223. your  system  because Iconify makes Cshell's internal window pointer invalid.
  224. Start Cshell with option "-a" or "-t" to use "Iconify" safely.
  225.  
  226.  
  227. IV. NOTES ON PIPES
  228. ------------------
  229.  
  230.     PIPES
  231.     PIPES  have  been implemented using temporary T:  files.  Thus, you
  232.     should be  careful  when  specifying  a 't:*' expansion as it might
  233.     include the temporary files. These files are deleted on completion
  234.     of the pipe segment.
  235.  
  236.     The file names used are completely unique, even with multiple shell
  237.     running simultaneously.
  238.  
  239.     My  favorite  new  feature is the fact that you can now redirect to
  240.     and  from,  and pipe internal commands.  'echo charlie >ram:x', for
  241.     instance.  Another favorite:
  242.  
  243.     echo "echo mem | csh" | csh
  244.  
  245.     No BCPL program should be output-append redirected (>>).
  246.  
  247.  
  248. V.  COMMAND PRE-PROCESSOR
  249. -------------------------
  250.  
  251.     PREPROCESSING
  252.     Preprocessing is done on the command line before it is passed on to
  253.     an internal or external routine:
  254.  
  255.     ^c    where c is a character is converted to that control
  256.         character. Thus, say '^l' for control-l.
  257.  
  258.     \233    insert character code 233 octal. Do not use values between
  259.         200o and 232o, as they have special meanings. \240 is the
  260.         word separator.
  261.  
  262.     $name    where name is a variable name. Variable names can consist
  263.         of 0-9, a-z, A-Z, and underscore (_).  The contents of the
  264.         specified variable is used.  If the shell variable doesn't
  265.         exist, csh tries to find a local or global (ENV:) variable
  266.         of the same name. If that fails, too, "$name" is inserted.
  267.         That is, if the variable 'i' contains 'charlie',
  268.         then '$i' -> 'charlie'.
  269.         If the variable 'i' doesn't exist, then '$i' -> '$i'.
  270.  
  271.     ;    delimits commands.   echo charlie ; echo ben.
  272.  
  273.     ' '    (a space). Spaces delimit arguments.
  274.  
  275.     "string" a quoted string. Trailing quotes are optional.
  276.         For instance, if you want to echo five spaces and an 'a':
  277.  
  278.         echo      a       -> a
  279.         echo "    a"      ->      a
  280.  
  281.         See also builtin variable "_cquote".
  282.  
  283.     \c    override the meaning of special characters.
  284.         '\^a' is a circumflex and an a rather than control-a.
  285.         To get a backslash, you must say '\\'.
  286.  
  287.         also used to overide alias searching for commands.
  288.  
  289.     >file    specify output redirection.  All output from the command is
  290.         placed in the specified file.
  291.  
  292.     >>file    specify append redirection
  293.         (Does not work with BCPL programs).
  294.  
  295.     <file    specify input redirection. The command takes input from the
  296.         file rather than the keyboard (note: not all commands
  297.         require input; it makes no sense to say 'echo <charlie'
  298.         since the 'echo' command only outputs its arguments).
  299.  
  300.     <>file    specify input AND output redirection. The file must be
  301.         either "NIL:" or an interactive stream (eg, a console
  302.         window: <>CON:////InOut).
  303.  
  304.     |    PIPE specifier.  The output from the command on the left
  305.         becomes the input to the command on the right.  The current
  306.         SHELL implementation uses temporary files to store the data.
  307.  
  308.     !!    execute the previously executed command.
  309.     !nn    (nn is a number).  Insert the history command numbered n
  310.         (see the HISTORY command)
  311.     !partial search backwards through the history list for a command
  312.         which looks the same as 'partial', and execute it.
  313.  
  314.     #    enter comment.  The rest of the line is discarded.
  315.         (note: \# will, of course, overide the comment character's
  316.                special meaning)
  317.  
  318.     {e hi;e ho} executes two commands as one, so they can be redirected
  319.         together (see ALIAS command). The trailing curly brace is
  320.         optional.
  321.  
  322.     $(foo)    insert the stdout of the command 'foo' at this position of
  323.         the command line. Every line of the output will count as one
  324.         argument. The closing parenthesis is optional.
  325.  
  326.     `foo`    insert the stdout of the command 'foo' at this position of
  327.         the command line. Every blank separated word will count as
  328.         one argument. Leading, trailing and multiple blanks will be
  329.         removed. The trailing backtick is optional.
  330.  
  331.     $nn    (nn is a number).  Cshell scripts only!
  332.         Insert argument number nn for $nn.  Thus, $1 becomes the
  333.         first argument, $2 the second, $3 the third and so on.
  334.         $0 is the name of the command (script).  If there's no
  335.         argument nn then $nn remains unchanged (unset variable).
  336.  
  337.     $#    Number of arguments.  Cshell scripts only!
  338.         For example: if $# is 3 then $3 will be the highest
  339.         meaningful variable for an argument.
  340.  
  341.     --    stop option parsing here. Works for internal commands only.
  342.         Example: rm -- -x will remove the file '-x'
  343.  
  344.     Please note the subtle differences between
  345.         alias count {echo one;echo two}
  346.         alias count "echo one;echo two
  347.     The first form will create an alias that contains a local alias. The
  348.     other will create a plain alias. Also, things within braces will not
  349.     be parsed more than once, therefore a backslash needs not be pre-
  350.     ceded by a pair of backslashes. Thus the commands look the same as
  351.     if they were to be typed in at the prompt. To echo lots of '#',
  352.     either use:
  353.         forever {echo \#
  354.         forever "echo \\\#
  355.     A block can spread over several lines. Refer to the SOURCE command.
  356.  
  357.  
  358. VI. COMMAND LINE EDITING
  359. ------------------------
  360.  
  361.     o The command line can be up to 255 chars.
  362.     o Inserts  and  deletes  are handled correctly over multiple lines.
  363.     o The script 'menu.sh' installs an intuition menu that contains most
  364.       editing functions
  365.  
  366.     EDITING
  367.  
  368.     -- MOVING --
  369.     Left Arrow      One character left
  370.     Right Arrow      One character right
  371.     Shift-Left Arrow  One word left
  372.     Shift-Right Arrow One word right
  373.     ESC-Left Arrow      Beginning of line (^A) (^Z)
  374.     ESC-Right Arrow      End of line       (^E)
  375.     -- DELETING --
  376.     Backspace      Previous character
  377.     Del          Character under cursor
  378.     ESC-Backspace      Previous word     (^W)
  379.     ESC-Del          Next word
  380.     ESC-x-Backspace      To start of line  (^B)
  381.     ESC-x-Del      To end of line    (^K)
  382.     ESC-d          Entire line       (^X)
  383.     -- HISTORY --
  384.     Up Arrow      Recall previous commands
  385.     Down Arrow      Recall commands
  386.     Shift-Up Arow      Get history from partial (or number)
  387.     Shift-Down Arrow  Go below last command of history
  388.     ESC-Up Arrow      Get start of history
  389.     ESC-Down Arrow      Get end of history
  390.     ESC-!          Get history from partial (or number)
  391.     ^T          Insert tail (all but first word) of previous line
  392.     ^P          Duplicate previous word (useful for mv)
  393.     -- COMPLETION --
  394.     TAB          Inserts first matching file name
  395.     Shift-TAB      Inserts longest common substring
  396.     ESC-TAB          Inserts all matching file names (also ESC-*)
  397.     ESC-c          Does a quick cd on left word (TAB for cycling)
  398.     ESC-~          Inserts the last current directory
  399.     ^D          Shows all files that match a pattern (also ESC-=)
  400.     ESC-p          Insert first/next matching program name
  401.     ESC-P          Shows all matching program names
  402.     -- EXECUTING LINE --
  403.     Return          Executes line
  404.     ESC-Return      Executes this line of history & brings up next one
  405.     ^N          Next line. Don't exec this one but store history
  406.     ^\          EOF (directly exits)
  407.     -- MISCELLANEOUS --
  408.     ^L          Retype current line.
  409.     ^O          Echo a ^O
  410.     ^R          Repeat last command (don't play with this)
  411.     ^U          Undo/Redo last edit
  412.     ^V          Quote next char
  413.     ESC-i          Toggle Insert/Overwrite
  414.     f1-f10          Execute command if variable exists.
  415.     F1-F10          More commands (Shifted f keys).
  416.     Help          Invokes help command
  417.  
  418. Whenever  the  cursor is placed on or directly after an incomplete file name
  419. and   you   press  TAB,  CShell  inserts  for  the  first  filename  (sorted
  420. alphabetically) that matches the name part already typed.  Any wildcards are
  421. allowed  here, if none are given, '*' is appended.  Immediately pressing TAB
  422. again  brings  up  the next file name that matched the substring.  Shift-TAB
  423. will  only  insert  the  as much as is common to all files that matched your
  424. abbreviation.  If pressed again, behaves just like TAB.  ESC-Tab inserts the
  425. name  of the directory where you would have ended up with a quick cd to that
  426. substring.
  427.  
  428. Note that ^D now means 'quit batchfile' like under AmigaDOS and is no longer
  429. used for quitting CShell.  If you want it back, enter 'keymap 0 4=41'
  430.  
  431. The  CTRL  keys  FGVY  are unset, feel free to map them to any function (see
  432. chapter XV).  You can also remap all preset keys.
  433.  
  434. VII. FUNCTION KEYS
  435. ------------------
  436.  
  437.     FUNKEY
  438.     Function keys now insert text to the current position on the command
  439.     line. They may be terminated with a ^M (return). f1 would be non-
  440.     shifted where as F1 is shifted.
  441.     Most of functions key have a default definition, but it may be
  442.     changed.
  443.  
  444.         $ set f1 dir df0:^M
  445.  
  446.     will add the text 'dir df0:<return>' to the current line.
  447.  
  448.         $ set f1 dir
  449.  
  450.     would only add 'dir' you could then enter ' df0:<return>'
  451.  
  452.  
  453. VIII. SHELL COMMANDS
  454. --------------------
  455.  
  456.     STARTUP OPTIONS
  457.     First to start shell from a CLI:
  458.  
  459.     csh [-abcCfiknstv] [-c command;command]
  460.     csh [-abcCfiknstv] [batchfile1 ... batchfileN]
  461.  
  462.      -a  AUX: mode. No command line editing and text highlighting
  463.           (window opening is not forced and AUTO-windows don't lose
  464.            the ability to be closed)
  465.      -b  starts shell in background, which means only task priority -1.
  466.      -c  allows execution of one command line and then exits out
  467.          of  shell.   This  is  useful for running an internal shell
  468.          commands in the background or from an external application:
  469.         run csh -c "dir df0:; copy -r df0: df1: >nil:; echo Done"
  470.      -C  same as -c, but the command line is not parsed twice. This
  471.          allows passing of file names with blanks within.
  472.         run csh -C rm "Ram Disk:tempfile"
  473.      -f  starts shell in foreground, which means only task priority 1.
  474.          you might reset this prioritiy to 0 at the end of your .login
  475.      -k  sets _nobreak before doing anything
  476.      -L  suppresses starting of s:.logout
  477.      -m  sets _nomatch  (which is unset by default)
  478.      -M  don't clear menus (especially for KingCON),
  479.          by default CSH clears menus of its window
  480.      -n  suppresses starting of s:.login
  481.      -N  suppresses starting of s:.cshrc
  482.      -s  globally enables the asterisk * as alias for #? in AmigaDOS 2.0
  483.          This means you can use * inside file requesters as well.
  484.          (obsolete option -- * is default -- #? is still allowed !!)
  485.      -t  terminal mode. You can use command line editing and text high-
  486.          lighting on a VT100 compatible terminal. To swap backspace
  487.          and DEL, refer to the 'keymap' command
  488.           (window opening is not forced and AUTO-windows don't lose
  489.            the ability to be closed)
  490.      -v  sets _verbose to 'hs' before doing anything.
  491.      -V  send only VT100 compatible control sequences
  492.           (no special Amiga control sequences)
  493.      -w  don't fetch pointer of window Cshell is running in,
  494.           eg, for running Cshell remote or with KingCON (iconify)
  495.           (menus, titlebar and some window related commands disabled)
  496.  
  497.     COMMAND EXECUTION
  498.  
  499.     Internal shell commands are case sensitive and may be abbreviated.
  500.     Also commands buffered with "rehash" may be abbreviated. This can
  501.     be toggled with the variable "_abbrev".
  502.  
  503.    The first argument is the command-name... here is (in order) how Shell
  504.    tries to execute it:
  505.  
  506.     1)  The alias list is searched for an alias with an exactly
  507.         matching name.
  508.     2)  Internal commands list is scanned for a command even partially
  509.         matching name (so you can, for instance, say resi for resident;
  510.         however, you should specify enough of a command to be unique).
  511.     3)  Then, the list of functions is scanned for a command that
  512.         matches completely. If one is found, the result of the function
  513.         is echoed to stdout.
  514.     4)  Now the command is assumed to be external.
  515.         Arguments with blanks, semicolons or empty strings will be
  516.         surrounded by quotes.
  517.     5)  If the file is a directory, a 'cd <file>' will be performed to
  518.         it.
  519.     6)  AmigaDOS resident list are scanned for it (you can use Shell's
  520.         'resident' command to add/remove a file in the DOS list).
  521.     7)  If the file is in the current directory and it's executable, it
  522.         is started.
  523.     8)  Then it is searched in the AmigaDOS path and c:
  524.     9)  Now, the shell path ($_path) is searched. If it's found and
  525.         executable, it's started. If it has the 's' bit set, it will
  526.         be executed using the appropriate shell. See FOREIGN SHELLS
  527.     10) If there exists a file with the suffix '.sh' and the same root
  528.         in the current directory or in the shell path, it is 'source'd.
  529.     11) Then the variable _rxpath is examined. If there exists a file
  530.         with the suffix '.rexx' and the same root in the current direc-
  531.         tory or in '$_rxpath', 'RX <file>' will be performed.
  532.     12) If all failed, an 'exec' action is sent to the file. See chapter
  533.         XIV for more info on classes and actions.
  534.  
  535.     To enforce that the external 'dir'-command is used, enter 'Dir'. It
  536.     is a good habit to uppercase the first letter of all external com-
  537.     mands, even if this is not necessary.
  538.  
  539.     AUTOMATIC SOURCING may be accomplished by naming shell scripts with
  540.     a .sh suffix.  Thus, if you say 'stuff' and the file 'stuff.sh'
  541.     exists in your current or anywhere in Shell search path (NOTE:
  542.     won't be found in the AmigaDOS path), it will be SOURCED with all
  543.     arguments you have given placed in the $_passed variable.  This is
  544.     equivalent to typing 'source stuff.sh'
  545.  
  546.     FOREIGN SHELLS are supported through key characters at the beginning
  547.     of their scripts.  If a file in the command search path has the s-bit
  548.     set, the first few bytes are read. If the first two are either '#!'
  549.     or ';!', the rest of the first line will be interpreted as the name
  550.     of the shell that is supposed to execute the script.
  551.     If they are '/*', the command 'RX' is used, if none of the above,
  552.     'c:Execute'. Example:
  553.       #!SKsh -c source
  554.  
  555.     WILDCARDS
  556.     Most shell commands will accept multiple arguments that can
  557.     be as a result of wild card expansion.  Also when calling
  558.     an external command shell will first expand any wild cards
  559.     to separate arguments.  If you wish to have the external command
  560.     handle it's own wild carding you will need to insert quotes
  561.     around the special wild card characters or use an alias (see
  562.     explanation of 'alias')
  563.  
  564.     eg.
  565.         arc a new.arc *.txt    - shell will expand and pass to arc
  566.         arc a new.arc "*.txt"    - let arc expand the wild cards.
  567.         alias arc "*a Arc $a"    - now shell will never expand
  568.  
  569.     The patterns are fairly extensive, and approximate some of the
  570.     ability of Unix/grep "regular expression" patterns.  Here are the
  571.     available tokens:
  572.  
  573.     ?    Matches a single character.
  574.     #    Matches the following expression 0 or more times.
  575.     (ab|cd)    Matches any one of the items seperated by '|'.
  576.     ~    Negates the following expression.  It matches all strings
  577.         that do not match the expression (aka ~(foo) matches all
  578.         strings that are not exactly "foo").
  579.     [abc]    Character class: matches any of the characters in the class.
  580.     [~bc]    Character class: matches any of the characters not in the
  581.         class.
  582.     a-z    Character range (only within character classes).
  583.     %    Matches 0 characters always (useful in "(foo|bar|%)").
  584.     *    Synonym for "#?", not available by default in 2.0. Available
  585.         as an option that can be turned on.
  586.  
  587.     "Expression" in the above table means either a single character
  588.     (ex: "#?"), or an alternation (ex: "#(ab|cd|ef)"), or a character
  589.     class (ex: "#[a-zA-Z]").
  590.  
  591.     Additional wildcards allowed:
  592.  
  593.     .../*    recursive search down ALL sub directories from current level
  594.     !    synonym for ~, supported for compatibility
  595.     &    prefixed to patterns, ask confirmation for each file
  596.     ~    the previous current directory (if separated)
  597.     Note that a pattern must contain a '?' or a '*', otherwise the other
  598.     special characters are not recognized. Furthermore, you cannot spe-
  599.     cify a single '?' as a pattern in the first argument to a command,
  600.     as this will be passed on to the command in order to show its usage.
  601.  
  602.     If pattern.library is present it LIBS:, it will be used for the
  603.     matching. (disabled, now Cshell always uses dos.library)
  604.  
  605.     Examples:
  606.  
  607.     df0:.../*    all files in all directories on df0:
  608.     df0:.../!*.info    full directory tree of df0: but exclude
  609.             any ugly .info files.
  610.     !*.o !*.c    will result in ALL files matching since what
  611.             doesn't match the !*.o will match the !*.c
  612.     df1:&*        all files in root of df1:, but ask
  613.             confirmation for each
  614.     *.[co]        all files ending in .c or .o
  615.     ~*.[co]        all files NOT ending in .c nor in .o
  616.     ~        the previous current directory
  617.     ~/*.c        all .c files in the previous current directory
  618.     ~//        the parent of the previous current directory
  619.     .        the current directory
  620.     ./foo.c        the same as foo.c
  621.     ..        the parent of the current directory
  622.     ../foo.c    the file foo.c in the parent directory
  623.  
  624.     Note that some commands prevent wild card expansion. These are:
  625.       - dir, rpn, whereis, window
  626.     Those commands will expand the wild cards themselves. This is why
  627.       dir @without( *.? , *.o )
  628.     will not work. Instead use:
  629.       set arg @without( *.? , *.o );dir $arg
  630.  
  631.     There is one exception to the rules given above: A single '?' as
  632.     the first argument will *not* expand in order to allow you to get
  633.     the usage of CLI and csh commands easily.
  634.  
  635.     Due to implementation limitations, patterns are only recognized
  636.     if they contain *, ?, [ or ]. To let Cshell expand patterns which
  637.     does not contain one of these chars just append "[]" to the
  638.     pattern (this will NOT change the meaning of the pattern!)
  639.  
  640.  
  641. LIST OF COMMANDS:
  642. -----------------
  643.  
  644.     ABORTLINE
  645.  
  646.     Usage    : abortline
  647.     Example    : echo a;abort;echo b
  648.     Results    : a
  649.  
  650.     Causes the rest of the line to be aborted. Intended for use in
  651.     conjunction with exception handling.
  652.  
  653.     ACTION
  654.  
  655.     Usage    : action [-a] actionname file [arguments]
  656.     Example : action extr csh515.lzh csh.doc
  657.  
  658.     Sends an action to a file. See chapter XIV CLASSES
  659.  
  660.     Options:
  661.      -a (abort) returns 0 if failed and 1 if successful. Otherwise,
  662.                 normal error codes (10 or 11) are returned
  663.  
  664.     ADDBUFFERS
  665.  
  666.     Usage    : addbuffers drive
  667.           addbuffers drive buffers [drive buffers ...]
  668.     Example    : addbuffers df0: 24
  669.  
  670.     Just like AmigaDOS addbuffers command, causes new buffers to be
  671.     allocated for disk I/O.  Each buffer costs 512 bytes of memory,
  672.     CHIP memory if a disk drive. Buffers may be negative (to remove
  673.     buffers from a drive).
  674.  
  675.     To show actual amount of buffers use "addbuffers drive"
  676.     or "addbuffers drive 0".
  677.  
  678.     ADDPART (or TACKON)
  679.  
  680.     Equivalent to TACKON.
  681.  
  682.     ALIAS
  683.  
  684.     Usage    : alias [name [command string] ]
  685.     Example    : alias vt "echo Starting VT100;run sys:tools/vt100"
  686.  
  687.     Sets a name to be a string. You can alias a single name to a set
  688.     of commands if you enclose them in quotes as above. By simply
  689.     typing vt, the command line above would be executed.
  690.  
  691.     Aliases may call each other, but direct recursion is prohibited,
  692.     so the following works: alias ls "ls -s"
  693.     To prevent alias replacement, enter: \ls
  694.  
  695.     If you run aliases into background, they will be recursively
  696.     resolved. This may result in endless loops, if the name of the
  697.     alias and the command it runs are equal. Use absolute pathes or
  698.     mix the case of the command to avoid recursion.
  699.  
  700.     By typing "alias name", you will get the alias for that name, while
  701.     with "alias" you get a list of all alias.
  702.  
  703.     ARGUMENT PASSING TO AN ALIAS:
  704.  
  705.     Usage    : alias name "%var[%var...] [ command_string ]"
  706.           alias name "*var[%var...] [ command_string ]"
  707.     Example    : alias xx "%q%w echo hi $q, you look $w
  708.           xx Steve great today
  709.     Results    : hi Steve, you look great today
  710.  
  711.     The second form of the alias command allows passing of arguments
  712.     to any position within the command string via use of a variable
  713.     name. To pass arguments to the end of a command string this method
  714.     is actually not necessary. These variables are local, so they don't
  715.     destroy another variable with the same name.
  716.     If you specify multiple arguments, every argument will be assigned
  717.     one word, and the last argument will be assigned the rest of the
  718.     command line.
  719.  
  720.     Using a '*' instead of the first '%' prevents wild card expansion:
  721.         alias zoo "*a zoo $a
  722.     To expand the wild cards after you got them, use
  723.         exec set a $a
  724.  
  725.     IMPLICIT ALIASES:
  726.  
  727.     Usage    : {command;command}
  728.           {%var command;command} arg arg
  729.     Example    : {%tmp echo $tmp $tmp} hello    --> hello hello
  730.  
  731.     Curly braces define temporary aliases. They can be redirected as
  732.     a whole, can have arguments and local variables. They count as
  733.     one argument, even if there are blanks inside (as with quotes), and
  734.     they may be nested. Complex alias definitions can use the braces
  735.     instead of quotes, although this will add some calling overhead.
  736.     The closing curly brace is optional if at the end of line.
  737.     Example:
  738.  
  739.     alias assert {e "Are you sure? ";input -s sure
  740.  
  741.     ASCII
  742.  
  743.     Usage    : ascii [-ho]
  744.           ascii [-ho] string
  745.  
  746.     If called without arguments, ascii outputs a complete ASCII table.
  747.     Given a string, shows each character in ASCII.
  748.  
  749.     Options:
  750.      -h shows numbers in hexadecimal
  751.      -o shows numbers in octal
  752.  
  753.     ASSIGN
  754.  
  755.     Usage    : assign
  756.           assign logical
  757.           assign [-adlnp] logical1 physical1 [log2 phy2 ... ]
  758.  
  759.     The first form shows all assigns.
  760.     The second form kills one assign.
  761.     The third form assigns logical1 to physical1 and so on.
  762.  
  763.     Options:
  764.      -a adds a new path to an existing assign
  765.      -d creates a deferred (late-binding) assign
  766.          (identical with old option -l)
  767.      -p creates a path (non-binding) assign
  768.          (identical with old option -n)
  769.  
  770.     For definition of add/defer/path, refer to your AmigaDOS manual.
  771.  
  772.     BASENAME
  773.  
  774.     Usage    : basename var path [path ...]
  775.     Example    : basename x df0:c/Dir    # sets x to "Dir"
  776.  
  777.     Sets var specified to basenames of paths.
  778.  
  779.     CAT (or TYPE)
  780.  
  781.     Usage    : cat [-n] [file file....]
  782.     Example    : cat foo.txt
  783.  
  784.     Type the specified files onto the screen.  If no file is specified,
  785.     STDIN in used (note: ^\ is EOF).  CAT is meant to output text files
  786.     only.
  787.  
  788.     Options:
  789.       -n  output numbered lines.
  790.  
  791.     CD
  792.  
  793.     Usage    : cd [path]
  794.           cd -g device1 [device2 [device3 ...]]
  795.  
  796.  
  797.     Options:
  798.      -g generate a list of all directories on the given devices.
  799.  
  800.     Change your current working directory.  You may specify '..' to go
  801.     back one directory (this is a CD specific feature, and does not
  802.     work with normal path specifications).
  803.  
  804.     In most cases, you won't have to use the CD command. Just type
  805.     the desired directory at the prompt (very handy in conjunction with
  806.     file name completion). Typing a ~ alone on a command line cd's
  807.     to previous current directory.
  808.  
  809.     There are two situations left when you still need it:
  810.  
  811.     Entering 'cd *tem' will cd to the first name matched.
  812.  
  813.     The second form generates a list (an ASCII file) of all direc-
  814.     tories on the given devices. It will be stored in the file given
  815.     in $_qcd (default: 'csh:csh-qcd'). Note that this ASCII file will
  816.     not be merged but overwritten. Once you have generated this file,
  817.     you can cd to any directory on your harddisk(s) even if it's not
  818.     in the current directory.
  819.     If you have two directories of the same name and you use one of
  820.     them more, move the more important one to the beginning of the
  821.     qcd file. You might also sort the file.
  822.     It is legal to type just an abbreviation of the directory name
  823.     you want to cd to. No asterisk '*' necessary. If you end up in
  824.     the wrong directory, cd to the same directory again (best done
  825.     by Cursor-Up + RETURN). You will cycle through all directories
  826.     that matched the given abbreviation. The other possibility is to
  827.     specify the full name of the parent directory: cd devs/keym
  828.     You may also add devices and assigns, so if 'PageStream:' is one
  829.     line in the qcd-file, a cd to 'page' is successful.
  830.  
  831.     CD without any arguments displays the path of the directory you
  832.     are currently in.
  833.  
  834.     CHGRP
  835.  
  836.     Usage    : chgrp group file1 ... filen
  837.     Example    : chgrp 42 myfile
  838.  
  839.     Set group-id (0-65535) or group-name of specified files.
  840.     (currently, name-to-id mapping is not implemented)
  841.  
  842.     CHMOD
  843.  
  844.     Usage    : chmod [u|g|o|a][+|-|=][flags] file1 ... filen
  845.     Example    : chmod u+rwe myfile
  846.  
  847.     Set AmigaDOS file protection flags for the file specified.
  848.     Valid flags are h, s, p, a, r, w, e, d.  (x is the same as e)
  849.  
  850.     Ownership:
  851.       u  Set specified bits for User (aka Owner)
  852.       g  Set specified bits for Group
  853.       o  Set specified bits for Other (not User, not Group)
  854.       a  all, alias for "ugo" (User/Group/Other)
  855.     Specifying no ownership is equal to 'u'.
  856.  
  857.     Modes:
  858.       +  Set specified bits, leave all others
  859.       -  Clear specified bits, leave all others
  860.       =  Set specified bits, clear all others
  861.     Specifying no mode is equal to '='.
  862.  
  863.     Archive bit cleared by default!
  864.  
  865.     Note: This command is equivalent to "protect" except that the
  866.           arguments for filename(s) and flag(s) are reversed.
  867.  
  868.     CHOWN
  869.  
  870.     Usage    : chown owner file1 ... filen
  871.     Example    : chown 42 myfile
  872.  
  873.     Set owner-id (0-65535) or owner-name of specified files.
  874.     (currently, name-to-id mapping is not implemented)
  875.  
  876.     CLASS
  877.  
  878.     Usage    : [-n] name {type=param} [ "actions" {action=command} ]
  879.     Example : class zoo offs=20,dca7c4fd ext=.zoo actions view="zoo l"
  880.  
  881.     Defines a new class of files and the actions to be taken on them
  882.     in various cases, or shows old definitions if given no arguments.
  883.     See section XIV: OBJECTS
  884.  
  885.     Options:
  886.       -n (new)  forgets old definitions
  887.  
  888.  
  889.     CLOSE
  890.  
  891.     Usage    : close [filenumber]
  892.  
  893.     Close the specified file opened by open. Without filenumber, closes
  894.     all open files. See open and flist for more info.
  895.  
  896.     CLS
  897.  
  898.     Usage    : cls
  899.  
  900.     This is an alias. It only clears the screen, but also works on a
  901.     terminal (echo ^L doesn't).
  902.  
  903.     COPY (or CP)
  904.  
  905.     Usage    : copy [-udfpmo]  file file
  906.     or    : copy [-udfpmo]  file1 file2...fileN dir
  907.     or    : copy [-rudfpo] dir1...dirN file1...fileN dir
  908.  
  909.     Options    :
  910.      -r recursive, copy all subdirectories as well.
  911.      -u update, if newer version exists on dest, don't copy
  912.      -f freshen, if file doesn't exist on dest or newer, don't copy
  913.      -q suppresses 'not newer' and 'not there' messages in -u and -f
  914.      -d don't set destination file date to that of source.
  915.      -p don't set destination protection bits to those of source.
  916.      -m erases the original. does not work with -r
  917.      -o overwrites write/delete-protected, reads read-protected
  918.      -a don't clear archive bit
  919.  
  920.     Example    : copy -r df0: df1:
  921.  
  922.     Copy files or directories. When copying directories, the -r option
  923.     must be specified to copy subdirectories as well.  Otherwise, only
  924.     top level files in the source directory are copied.
  925.  
  926.     All files will be displayed as they are copied and directory's
  927.     displayed as they are created. This output can be suppressed by
  928.     redirecting to nil: eg. copy -r >nil: df0: df1:
  929.  
  930.     Copy will abort after current file on Control-C.
  931.  
  932.     Copy by default sets the date of the destination file to that of
  933.     the source file. To overide this feature use the -d switch.
  934.  
  935.     Similarly, it sets protection bits (flags) to those of source and
  936.     any file comment will be copied. To avoid this use -p. The archive
  937.     bit is always cleared by default (use option -a to leave it
  938.     untouched).
  939.  
  940.     Another useful option is the -u (update) mode where copy will not
  941.     copy any files which exists already in the destination directory
  942.     if the destination file is newer or equal to the source file.
  943.     This is useful when developing code say in ram: eg. 'copy *.c ram:'
  944.     when done you can copy -u ram: df1: and only those modules you have
  945.     modified will be copied back.
  946.  
  947.     Copy command will now create the destination directory if it does
  948.     not exist when specified as 'copy [-r] dir dir'. If you specify
  949.     copy file file file dir, then 'dir' must already exist.
  950.  
  951.     CP (or COPY)
  952.  
  953.     Equivalent to COPY.
  954.  
  955.     DATE
  956.  
  957.     Usage    : date [-bsr] [new date and/or time]
  958.     Example    : date Wednesday  # this refers to NEXT wed, of course
  959.  
  960.     Options:
  961.       -b print date/time from the battery clock, if existent
  962.       -s stores the current time internally
  963.       -r shows time relative to last stored in secs and hundredths
  964.  
  965.     Used to read or set system date and/or time. All standard options
  966.     may be used (yesterday, tomorrow, monday, etc.).
  967.     Leading zero's are not necessary.
  968.     Without parameters shows Dddddd DD-MMM-YY HH:MM:SS.
  969.  
  970.     DEC
  971.  
  972.     Usage    : dec varname [value]
  973.     Example    : dec abc
  974.  
  975.     Decrement the numerical equivalent of the variable with specified
  976.     value (default: 1) and place the ASCII-string result back into
  977.     that variable.
  978.  
  979.     DELETE (or RM)
  980.  
  981.     Usage    : delete [-fpqrv] file file file...
  982.     Example    : delete foo.txt test.c
  983.  
  984.     Remove (delete) the specified files.  Remove always returns
  985.     errorcode 0.  You can remove empty directories.
  986.  
  987.     Options:
  988.      -r recursively remove non-empty directories.
  989.      -p (or f); remove delete-protected files.
  990.      -v toggle verbose output.  Useful if 'delete' is aliased.
  991.      -q (quit), delete aborts if the file to be removed didn't exist
  992.          or couldn't be deleted. This does _not_ affect non-matching
  993.          wildcards.
  994.  
  995.     If you specify any wildcard deletes the files will be listed as
  996.     they are deleted. This can be suppressed by redirecting to nil:
  997.  
  998.     DIR (or LS)
  999.  
  1000.     Usage    : dir [-abcdfhiklnoqstuv] [-z [lformat]] [path path ... ]
  1001.     Example    : dir -ts downloads:
  1002.           dir -lz "%7s %-.16n %m" *.c
  1003.     Options:
  1004.      -d list directories only
  1005.      -f list files only
  1006.      -h list only files which not start with a dot, end with '.info' or
  1007.         have the h-flag set. Adds an 'i' bit to the flags which tells
  1008.         if an according .info file exists.
  1009.      -s short multi(4) column display.
  1010.      -c don't change colors for directories
  1011.      -q quiet display. does not show length in blocks
  1012.      -o display file nOtes
  1013.      -n display names only
  1014.      -p display full path names and suppress directory titles
  1015.      -a shows the age of all files in the format  days hours:minutes
  1016.      -i identifies every file, shows the type instead of the date.
  1017.         See chapter XIV CLASSES
  1018.      -v (viewdir) recursively sums up lengths of the files in a dir
  1019.      -l sorts the files by their length, longest first.
  1020.      -t sorts the files by their time, most recent first.
  1021.      -k sorts the files by their class (klass)
  1022.      -b sorts the files backwards.
  1023.      -g prints directories at the beGinning
  1024.      -e prints directories at the End
  1025.      -u must be given exactly two directories. Shows files only in
  1026.         the first directory, files in both and files in the second.
  1027.      -z custom format
  1028.         (must be followed by an argument which holds the format string)
  1029.  
  1030.     Displays a directory of specified files. Default output shows
  1031.     date, protection, block size, byte size and total space used.
  1032.     Protections flags include new 1.2/1.3 flags (see under protect),
  1033.     plus a 'c' flag which indicates that this file has a comment.
  1034.     Files are alphabetically sorted, without case sensitivity, and
  1035.     directories are in red pen (unless you use -c). Dir takes in
  1036.     account the width of your window.
  1037.  
  1038.     To recursively show the contents of a directory and all its
  1039.     sub-directories use the special wildcard pattern ".../*", see
  1040.     section "WILDCARDS" (man wildcards).
  1041.  
  1042.     The lformat string (option -z) is used to create your own directory
  1043.     format. Instead of the "-z lformat" command line argument you can
  1044.     set the variable "_dirformat" (which holds "lformat", but you must
  1045.     set option -z anyhow).
  1046.     Your custom format may contain the following codes:
  1047.      %a age               %l LF if comment      %t time
  1048.      %b size in blocks    %m multi column       %u size in K
  1049.      %c flag c (comment)  %n name               %v dir size in eng.
  1050.      %d date              %o filenote (comment) %w dir size in K
  1051.      %e flag i (.info)    %p name w/ path       %x translated date
  1052.      %f flags "hsparwed"  %q name w/ slash      %+ flag i as '+' or ' '
  1053.      %i flag d (dIr)      %r size in eng.
  1054.      %k class             %s size
  1055.  
  1056.      %I link information (S: softlink, H: hardlink, P: pipe, -: else)
  1057.      %L name of original file if link (empty otherwise)
  1058.      %N name + original name (of link)
  1059.      %F protection bits (flags "rwed") for group/other
  1060.      %U user-id
  1061.      %G group-id
  1062.  
  1063.     Between the '%' and the identifying letter, there may be an optional
  1064.     field width. If the number is preceded by a '-', the field contents
  1065.     will be left adjusted. If by a dot, the contents will be cut down
  1066.     to match the field width if they are longer.
  1067.     If the format string contains a %m, cshell will try to print more
  1068.     than one entry on one line. The column width is the field width of
  1069.     the %m entry. If omitted, it's assumed to be the one of the first
  1070.     file. If a file is longer, it will use two columns.
  1071.  
  1072.     If you prefer the old output-style of this command (5.19 and before)
  1073.     add the following line to your .cshrc file:
  1074.      set _dirformat "   %-24n %c%f %7s %4b %d %t"
  1075.  
  1076.     DISKCHANGE
  1077.  
  1078.     Usage    : diskchange drive...drive
  1079.  
  1080.     Like AmigaDOS diskchange.  Multiple drive names are allowed.
  1081.  
  1082.     ECHO
  1083.  
  1084.     Usage    : echo [-en] string
  1085.     Example    : echo hi there
  1086.     Results    : hi there
  1087.  
  1088.     Options:
  1089.      -n don't append newline.
  1090.      -e echo to stderr.
  1091.  
  1092.     Echo the given string.
  1093.  
  1094.     ELSE
  1095.  
  1096.     Usage    : else ; command
  1097.     Usage    : if -f foo.c ; else ; echo "Not there" ; endif
  1098.  
  1099.     Else clause, must follow an IF statement.
  1100.  
  1101.     ENDIF
  1102.  
  1103.     Usage    : endif
  1104.  
  1105.     The end of an if statement.
  1106.  
  1107.     Note: if you return from a script file with unterminated IF's
  1108.     and the last IF was false, prompt will be changed to an
  1109.     underscore ('_') and no commands will be executed until
  1110.     'endif' is typed.
  1111.  
  1112.     ERROR
  1113.  
  1114.     Usage    : error n
  1115.  
  1116.     Generates return code n.
  1117.  
  1118.     EXEC
  1119.  
  1120.     Usage    : exec [-i] command [args]
  1121.     Example    : set cmdline "dir ram:"
  1122.           exec $cmdline        # would not work without exec
  1123.  
  1124.     Options:
  1125.      -i  return code 0.
  1126.  
  1127.     Execute the command specified; exec command is equivalent to
  1128.     command, only you can use variables to specify command name.
  1129.     Note that the command line is parsed TWICE! Examples:
  1130.      set a dir ram:; exec $a              # right
  1131.      set a mkdir; exec $a "My directory"  # wrong! creates 2 directories
  1132.  
  1133.     Exec returns the return code of the command executed unless
  1134.     option -i (ignore) is set, in which case always 0 is returned.
  1135.  
  1136.     FAULT
  1137.  
  1138.     Usage    : fault error1 .. errorN
  1139.     Example    : fault 205 212
  1140.  
  1141.     Like AmigaDOS fault, prints specified error messages.
  1142.  
  1143.     FILENOTE
  1144.  
  1145.     Usage    : filenote file1 .. fileN  note
  1146.           filenote -s file1...fileN
  1147.  
  1148.     Options:
  1149.      -s (second form) ; displays the file notes of the given files.
  1150.  
  1151.     The first form sets AmigaDOS comment of the specified file.
  1152.  
  1153.     FLIST
  1154.  
  1155.     Usage    : flist
  1156.  
  1157.     Lists the filenumbers of files opened by open.
  1158.     See open and close for more info.
  1159.  
  1160.     FLTLOWER
  1161.  
  1162.     Usage    : fltlower
  1163.     Example    : dir | fltlower
  1164.     Or    : fltlower <readme
  1165.  
  1166.     This is a filter command, i.e. it reads from stdin and writes to
  1167.     stdout. The more natural way to use it is a pipe, or it can be
  1168.     redirected.
  1169.     Its purpose is to convert all alphabetic to lower case.
  1170.  
  1171.     FLTUPPER
  1172.  
  1173.     The same of fltlower, only this converts to upper case.
  1174.  
  1175.     FOREACH
  1176.  
  1177.     Usage    : foreach [-v] varname ( strings ) command
  1178.     Example    : foreach i ( a b c d ) "echo -n $i;echo \" ha\""
  1179.     Result    : a ha
  1180.           b ha
  1181.           c ha
  1182.           d ha
  1183.  
  1184.     Options:
  1185.      -v display arguments every time command is executed.
  1186.  
  1187.     'strings' is broken up into arguments.  Each argument is placed in
  1188.     the local variable 'varname' in turn and 'command' executed. Put
  1189.     the command(s) in quotes.
  1190.  
  1191.     Foreach is especially useful when interpreting passed arguments in
  1192.     an alias.
  1193.  
  1194.     eg.
  1195.         foreach i ( *.pic ) viewilbm $i
  1196.     assuming a.pic and b.pic in current directory the following commands
  1197.     will occur:
  1198.         viewilbm a.pic
  1199.         viewilbm b.pic
  1200.  
  1201.     All 'for...' commands can be interrupted using CTRL-D or CTRL-E.
  1202.  
  1203.     FOREVER
  1204.  
  1205.     Usage    : forever command
  1206.     or    : forever "command;command;command..."
  1207.  
  1208.     The specified commands are executed over and over again forever.
  1209.  
  1210.     Execution stops if you hit ^C or ^D, or if the commands return with
  1211.     an error code.
  1212.  
  1213.     FORLINE
  1214.  
  1215.     Usage    : forline var filename command
  1216.     or    : forline var filename "command;command..."
  1217.     Example    : forline i RAM:temp "echo line $_linenum=$i"
  1218.  
  1219.     For each ASCII line of file specified commands are executed and
  1220.     var points to line content. You can check system variable _linenum
  1221.     to find the number of the line currently read.
  1222.     If STDIN (case sensitive) is specified as input file, the lines are
  1223.     read from standard input.
  1224.  
  1225.     FORNUM
  1226.  
  1227.     Usage    : fornum [-v] var n1 n2 command
  1228.     or    : fornum [-v] -s var n1 n2 step command
  1229.  
  1230.     Example    : fornum -v x 1 10 echo $x
  1231.     or    : fornum -s x 10 1 -1 echo $x # counts backwards
  1232.  
  1233.     Executes  command(s)  for  all numerical values of x between n1 and
  1234.     n2.   If  more  than  one  command  is  specified,  or  command  is
  1235.     redirected, include command(s) in quotes.
  1236.  
  1237.  
  1238.     Options:
  1239.      -v (verbose) causes printing of progressive numbers.
  1240.      -s specify a step; if negative, the count will be backwards.
  1241.  
  1242.     GETENV
  1243.  
  1244.     Usage    : getenv [shellvar] envvar
  1245.  
  1246.     Gets the value of an ENV: variable and stores it in the shell
  1247.     variable 'shellvar'. If shellvar is omitted, the value of the
  1248.     ENV: variable is printed to stdout.
  1249.     This command is obsolete since ENV: variables can be retrieved
  1250.     by writing $envvar anywhere on the command line.
  1251.  
  1252.     GOTO
  1253.  
  1254.     Usage    : goto label
  1255.     Example    :
  1256.           label start
  1257.             echo "At start"
  1258.             dir ram:
  1259.             goto start
  1260.  
  1261.     Goto  the specified label name.  You can only use this command from
  1262.     a  source  file.   Labels  may  be  forward or reverse from current
  1263.     position. It is legal to jump out of if's.
  1264.  
  1265.     HEAD
  1266.  
  1267.     Usage    : head [filename] [num]
  1268.     Example    : head readme 20
  1269.  
  1270.     Display first "num" lines of "filename".   If num is not specified,
  1271.     10 is assumed. If filename is not specified, standard input (stdin)
  1272.     is taken instead.
  1273.  
  1274.     HELP
  1275.  
  1276.     Usage    : help [-f]
  1277.     Example    : help
  1278.     Options    :
  1279.      -f list functions also
  1280.  
  1281.     Simply  displays  all  the  available  commands.   The commands are
  1282.     displayed in search-order.  That is, if you give a partial name the
  1283.     first  command  that  matches  that  name  in  this list is the one
  1284.     executed.   Generally,  you  should  specify enough of a command so
  1285.     that it is completely unique.
  1286.  
  1287.     HISTORY
  1288.  
  1289.     Usage    : history [-nr] [partial_string]
  1290.     Example    : history
  1291.  
  1292.     Options    :
  1293.      -n omits line numbering
  1294.      -r reads history from stdin
  1295.  
  1296.     Displays  the  enumerated  history  list.   The size of the list is
  1297.     controlled  by  the  _history  variable.   If you specify a partial
  1298.     string, only those entries matching that string are displayed.
  1299.  
  1300.     HOWMANY
  1301.  
  1302.     Usage    : howmany
  1303.  
  1304.     This  command  tells you how many instances of Shell are running in
  1305.     your system.
  1306.  
  1307.     HTYPE
  1308.  
  1309.     Usage    : htype [-r] [file1..fileN]
  1310.  
  1311.     Options:
  1312.      -r display all files in a directory.
  1313.  
  1314.     Displays the specified files in hex and ASCII, just like the system
  1315.     command 'Type file opt h'.  Especially suitable for binary files.
  1316.  
  1317.     If there are no filenames specified, standard input is used,
  1318.     so you can use htype as the destination for a pipe.
  1319.  
  1320.     IF
  1321.  
  1322.     Usage    : if [-n] argument conditional argument [then]
  1323.     or    : if [-n] argument
  1324.     or    : if [-n] -f file    or   -e file
  1325.     or    : if [-n] -d file/dir
  1326.     or    : if [-n] -m
  1327.     or    : if [-n] -t file file1 .. fileN
  1328.     or    : if [-n] -r rpnexpression
  1329.     or    : if [-n] -v varname
  1330.     or    : if [-n] -o char arg ... arg
  1331.  
  1332.     Options:
  1333.      -n (NOT) reverses the result.
  1334.      -d tests the type of the object specified: if it is a
  1335.         directory, then TRUE; if it is a file (or it doesn't exist)
  1336.         then FALSE.
  1337.      -f (or -e) checks for existance of the specified file.
  1338.      -m test if FAST memory is present.
  1339.      -o tests for option 'char' in the rest of the arguments.
  1340.      -r evaluates a given RPN expression (see under RPN for more info).
  1341.         If value on top of stack is 0, then FALSE, else TRUE.
  1342.      -t compare the date and time of the first file with all the others;
  1343.         if the first is younger than ALL the others, then FALSE,
  1344.         else TRUE. If a file doesn't exists, it is considered as
  1345.         being older.
  1346.      -v test if a given variable is defined.
  1347.  
  1348.  
  1349.     Makes the following instructions up to the next endif conditinal.
  1350.     The 'then' is optional. The if clause must be followed by a semi-
  1351.     colon if instructions follow on the same line.
  1352.  
  1353.     If a single argument is something to another argument.  Conditional
  1354.     clauses allowed:
  1355.  
  1356.     <, >, =, ! and combinations.  Thus != is not-equal, >= larger or
  1357.     equal, etc...
  1358.  
  1359.     If arguments are not numeric, they are compared as strings.
  1360.  
  1361.     Usually the argument is either a constant or a variable ($varname).
  1362.  
  1363.     The second form of IF is conditional on the existence of the
  1364.     argument.  If the argument is a "" string, then FALSE, else TRUE.
  1365.  
  1366.     The third form of IF used by -f switch checks for existance of
  1367.     the specified file. -e is the same as -f
  1368.  
  1369.     Option -m is used to test if FAST memory is present.
  1370.     Example (to be included in a login.sh file):
  1371.     if -m; resident -d lc1 lc2 blink; endif
  1372.  
  1373.     Using -t form compares the date and time of the first file with
  1374.     all the others; if the first is younger than ALL the others, then
  1375.     FALSE, else TRUE. If a file doesn't exists, it is considered as
  1376.     being older.
  1377.     This feature is especially useful for building makefiles without
  1378.     using any MAKE utility.
  1379.  
  1380.     Example:
  1381.     if -t test.o test.asm test.i ; asm -o test.o test.asm ; endif
  1382.  
  1383.  
  1384.     Option -o tests for option 'char' in the rest of the arguments.
  1385.  
  1386.     Example: if -o r -rp ram:comm1.c     will yield TRUE.
  1387.  
  1388.     When using 'IF' command interactively if you are entering commands
  1389.     following an 'IF' that was false, the prompt will be set to a
  1390.     underscore '_ ' to indicate all commands will be ignored until
  1391.     an 'ELSE' or 'ENDIF' command is seen.
  1392.  
  1393.     INC
  1394.  
  1395.     Usage    : inc varname [value]
  1396.     Example    : inc abc 5
  1397.  
  1398.     Increment the numerical equivalent of the variable with specified
  1399.     value (default: 1) and place the ASCII-string result back into
  1400.     that variable.
  1401.  
  1402.     INFO
  1403.  
  1404.     Usage    : info [-pt] [path1 path2 ... pathN]
  1405.  
  1406.     Options    :
  1407.      -p  only display drives with readable (present) disks
  1408.      -t  print disk/fs type and bytes used instead of block sizes
  1409.  
  1410.     If called without arguments, info gives you the drive information
  1411.     on all devices. If one or more paths are specified, only infor-
  1412.     mation on those drives will be displayed.
  1413.  
  1414.     Note: Cshell does (correct) rounding for all displayed values,
  1415.           Commodore's Info command does not. So values may slightly
  1416.           change.
  1417.  
  1418.     INPUT
  1419.  
  1420.     Usage    : input [-sr] var var ... var
  1421.     Example    : input abc
  1422.  
  1423.     Options    :
  1424.      -s the whole line is read in as one word, including spaces.
  1425.      -r puts the console to single character mode before reading,
  1426.         ie. does not wait for RETURN to be pressed). Use with care.
  1427.  
  1428.     Input from STDIN (or a redirection, or a pipe) to a variable.  The
  1429.     next input line is broken up in words (unless quoted) and placed in
  1430.     the variable.
  1431.  
  1432.     JOIN
  1433.  
  1434.     Usage    : join [-r] file1..fileN destfile
  1435.     Example    : join part1 part2 part3 total
  1436.  
  1437.  
  1438.     Options    :
  1439.      -r overwrite any existent destfile.
  1440.  
  1441.     Joins (concatenates) the specified files to get destfile. Join
  1442.     will refuse to overwrite an existing destfile, unless the
  1443.     'r' option is used.
  1444.  
  1445.     KEYMAP
  1446.  
  1447.     Usage    : keymap [number {key=function}]
  1448.     Example    : keymap 0 1030=4 1032=12
  1449.  
  1450.     Defines one keymap for the csh command line editing. See chapter XV.
  1451.  
  1452.     LABEL
  1453.  
  1454.     Usage    : label name
  1455.  
  1456.     Create a program label right here. Used in source files, you can
  1457.     then GOTO a label.
  1458.  
  1459.     LINECNT
  1460.  
  1461.     Another filter. Counts the number of lines of its stdin and writes
  1462.     it to stdout.
  1463.  
  1464.     LN (or MAKELINK)
  1465.  
  1466.     Usage    : ln [-s] filename [linkname]
  1467.     Example    : ln stuff/data newname
  1468.  
  1469.     Options    :
  1470.      -s make soft link (default is hard link)
  1471.  
  1472.     ln creates an additional directory entry, called a link,  to
  1473.     a file or directory.  Any number of links can be assigned to
  1474.     a file.
  1475.  
  1476.     filename is the name of  the  original  file  or  directory.
  1477.     linkname  is  the  new  name  to  associate with the file or
  1478.     filename.  If linkname is omitted,  the  last  component  of
  1479.     filename is used as the name of the link.
  1480.  
  1481.     A hard link (the default) is a standard directory entry just
  1482.     like the one made when the file was created.  Hard links can
  1483.     only be made to existing files.  Hard links cannot  be  made
  1484.     across file systems (disk partitions, mounted file systems).
  1485.     To remove a file, all hard links  to  it  must  be  removed,
  1486.     including  the  name by which it was first created; removing
  1487.     the last hard link releases the inode  associated  with  the
  1488.     file.
  1489.  
  1490.     A symbolic link, made with  the  -s  option,  is  a  special
  1491.     directory entry that points to another named file.  Symbolic
  1492.     links can span file systems and point  to  directories.   In
  1493.     fact,  you  can create a symbolic link that points to a file
  1494.     that is currently absent from the file system; removing  the
  1495.     file that it points to does not affect or alter the symbolic
  1496.     link itself.
  1497.  
  1498.     NOTE: Symbolic links (also known as "soft links") are
  1499.           currently NOT SUPPORTED by AmigaOS.  DO NOT USE!
  1500.  
  1501.     LOCAL
  1502.  
  1503.     Usage: local [var...var]
  1504.  
  1505.     Creates one or more local variables. Those variables disappear
  1506.     at the end of their alias or source file, and cannot be accessed
  1507.     from inside other aliases or source files.
  1508.     With no arguments, shows all top level variables and their values.
  1509.  
  1510.     LS (or DIR)
  1511.  
  1512.     Equivalent to DIR.
  1513.  
  1514.     MAKELINK (or LN)
  1515.  
  1516.     Equivalent to LN.
  1517.  
  1518.     MAN
  1519.  
  1520.     Usage    : man command(s)
  1521.     Example    : man mkdir
  1522.  
  1523.     Get  info about a Shell command, or others keywords.  These include
  1524.     all  special  _variables, plus various keywords:  WILDCARDS, PIPES,
  1525.     EDITING, STARTUP and more.
  1526.     See special alias manlist to get a list of ALL keywords supported
  1527.     by man.
  1528.     You  must set _man to the paths of your .doc files:
  1529.        set _man dh1:docs/aliases.doc dh1:docs/csh.doc
  1530.  
  1531.     To create your own .doc files, precede all your keywords by four
  1532.     blanks. 'man' will then display lines until the first character
  1533.     of a line is alphanumeric or has four leading blanks.
  1534.  
  1535.     MD (or MKDIR)
  1536.  
  1537.     Equivalent to MKDIR.
  1538.  
  1539.     MEM
  1540.  
  1541.     Usage    : mem [-cfqsl]
  1542.  
  1543.     Options:
  1544.       -c shows the free chip mem only
  1545.       -f shows the free fast mem only
  1546.       -q outputs just a number without titles
  1547.       -s stores current free memory
  1548.       -r shows memory used relative to last stored
  1549.       -l flushes all unneeded memory
  1550.  
  1551.     MENU
  1552.  
  1553.     Usage    : menu [-mn] [ title item...item ]
  1554.     Example    : menu Shell   JrComm,,j   Rename,"rename ",r  quit
  1555.  
  1556.     Options:
  1557.      -n clear all existing menus.
  1558.      -m use monospaced font.
  1559.  
  1560.     Appends one pull down in the current console window. Up to 31
  1561.     menus with 63 items each (including title) can be installed.
  1562.  
  1563.     If the item is just a string, that string will be in the menu item.
  1564.     When you select it, it will be put into the prompt and executed.
  1565.  
  1566.     If there is a comma and after that comma a second string, this
  1567.     will be the command will be inserted at the prompt. This time you
  1568.     have to add the ^M yourself if you want the command to be executed.
  1569.  
  1570.     If there is a second comma, the letter after that comma will be
  1571.     the keyboard shortcut for that menu item. (This will be case
  1572.     sensitive some day, use lowercase).
  1573.  
  1574.     If for any reason your current menu is corrupt, just enter an
  1575.     empty 'menu' command.
  1576.  
  1577.     When the first menu is installed you can use option -m to choose
  1578.     a monospaced font (System Default Font) instead of the default
  1579.     Intuition Font (which may be a proportional font). This is useful
  1580.     for user-formatted menus (like in the example script "menu.sh").
  1581.  
  1582.     MKDIR (or MD)
  1583.  
  1584.     Usage    : mkdir [-p] name name name...
  1585.     Example    : mkdir df0:stuff
  1586.  
  1587.     Options:
  1588.      -p create all dirs in path if necessary.
  1589.  
  1590.     Create the specified directories.
  1591.     If "name" ends with trailing slash it will be stripped off.
  1592.  
  1593.     mkdir now supports the -p option.  mkdir -p followed by a full path
  1594.     name will create all directories necessary to make the path.  For
  1595.     example, suppose that the directory ram:foo exists and is empty.
  1596.     "mkdir -p ram:foo/bar/tst/a" would create ram:foo/bar,
  1597.     ram:foo/bar/tst, and ram:foo/bar/tst/a all in one step.
  1598.     In addition, it will issue no error codes for directories it cannot
  1599.     make.
  1600.  
  1601.     MV (or RENAME)
  1602.  
  1603.     Equivalent to RENAME.
  1604.  
  1605.     OPEN
  1606.  
  1607.     Usage    : open filename filemode filenumber
  1608.     Example    : open RAM:data w 1
  1609.  
  1610.     This  allows you to open a file, redirect to it as many commands as
  1611.     you like, then close it.
  1612.     Filename is any valid AmigaDOS filename, filemode is either "r" for
  1613.     read or "w" for write, filenumber is a number between 1 and 10.
  1614.     To  redirect  a  program to or from an open file, use as your redir
  1615.     filename a dot followed by the filenumber.
  1616.     Here is a complete example:
  1617.  
  1618.         open RAM:data w 1
  1619.         echo -n 2+2= >.1
  1620.         rpn 2 2 + . CR >.1
  1621.         close 1
  1622.         type RAM:data    # will display 2+2=4
  1623.  
  1624.     See also close, flist.
  1625.  
  1626.     PATH
  1627.  
  1628.     Usage    : path [-gr] [dir...dir]
  1629.  
  1630.     Without arguments, lists AmigaDOS path. Otherwise adds given
  1631.     directories to the path, preventing duplicate entries.
  1632.  
  1633.     Options:
  1634.      -r Resets the path
  1635.      -g Global path modifications; operations (add, reset) apply to all
  1636.          CLI processes instead of only the current one
  1637.  
  1638.     Note:
  1639.     It's not perfectly "legal" to modify the path-list of other
  1640.     processes. Adding entries (option -g) works fine in most cases.
  1641.     But the removal of entries (options -gr together) may crash the
  1642.     system, because CSH doesn't know about the memory handling of
  1643.     other processes (it doesn't know how they allocated the memory
  1644.     for the path-list entries).
  1645.  
  1646.     So use option -g always with care (at least together with -r).
  1647.     If it works, it's okay. If not, you lose ;-)  There's no 100%
  1648.     reliable way for global path modifications.
  1649.  
  1650.     PRI
  1651.  
  1652.     Usage    : pri clinumber pri
  1653.     Example    : pri 3 5    # set priority of cli #3 to 5
  1654.  
  1655.     Change the priority of the specified task (use PS command to
  1656.     determine clinumber). If you specify 0 as clinumber you can
  1657.     change priority of "this" task (the one executing shell).
  1658.  
  1659.     PROTECT
  1660.  
  1661.     Usage    : protect file1 ... filen [u|g|o|a][+|-|=][flags]
  1662.     Example    : protect myfile u+rwe
  1663.  
  1664.     Set AmigaDOS file protection flags for the file specified.
  1665.     Valid flags are h, s, p, a, r, w, e, d.  (x is the same as e)
  1666.  
  1667.     Ownership:
  1668.       u  Set specified bits for User
  1669.       g  Set specified bits for Group
  1670.       o  Set specified bits for Other (not User, not Group)
  1671.       a  all, alias for "ugo" (User/Group/Other)
  1672.     Specifying no ownership is equal to 'u'.
  1673.  
  1674.     Modes:
  1675.       +  Set specified bits, leave all others
  1676.       -  Clear specified bits, leave all others
  1677.       =  Set specified bits, clear all others
  1678.     Specifying no mode is equal to '='.
  1679.  
  1680.     Archive bit cleared by default!
  1681.  
  1682.     Note: This command is equivalent to "chmod" except that the
  1683.           arguments for filename(s) and flag(s) are reversed.
  1684.  
  1685.     PS
  1686.  
  1687.     Usage    : ps [-les] [commandname...commandname]
  1688.  
  1689.     Options:
  1690.      -l shows full pathnames of commands
  1691.      -e excludes the given command names from the list
  1692.      -s don't show stacksize and type, use old output-format instead
  1693.  
  1694.     Gives status of CLI processes.  eg:
  1695.  
  1696.     Proc Command Name         Typ  Stack  Pri.  Address  Directory
  1697.     * 1  csh                  fr   10000    0      97b0  Stuff:shell
  1698.       2  clock                bw    4096  -10    2101a8  Workdisk:
  1699.       3  emacs                bw   30000    0    212f58  Stuff:shell
  1700.       4  VT100                bw    4000    0    227328  Workdisk:
  1701.  
  1702.     Address is the address of the task, directory is the process
  1703.     currently CD'd directory. My default, only the BaseNames of
  1704.     the commands are shown. Your own CLI will be marked by an
  1705.     asterisk in the first column.
  1706.  
  1707.     Stack size is the _real_ size of a command's stack. It's _not_
  1708.     the size a program gets if it's launched by this command.  Use
  1709.     "Status" instead if you need the size of the Default Stack.
  1710.     (be aware: "Status" does _not_ show the stack size used by a prog!)
  1711.  
  1712.     Typ are two letters.  The first is either "f" (foreground) or
  1713.     "b" (background).  The second is one of:
  1714.         i: invalid
  1715.         a: added
  1716.         r: running / ready to run
  1717.         w: waiting
  1718.         e: except
  1719.         d: removed
  1720.  
  1721.     PWD
  1722.  
  1723.     Usage    : pwd
  1724.  
  1725.     Rebuild _cwd by backtracing from your current directory.
  1726.  
  1727.     QSORT
  1728.  
  1729.     Usage    : qsort [-cr] <in >out
  1730.  
  1731.     Options :
  1732.      -c case-sensitive
  1733.      -r reverse sort
  1734.  
  1735.     Quick sorts from stdin to stdout (case-insensitive).
  1736.  
  1737.     QUIT
  1738.  
  1739.     Usage    : quit
  1740.  
  1741.     Quit out of Shell back to CLI.
  1742.  
  1743.     RBACK
  1744.  
  1745.     Usage    : rback command
  1746.  
  1747.     Start a new process executing the specified command, but can't do
  1748.     input/output. Equivalent to 'run command >NIL: <NIL:'. Instead of
  1749.     using rback, you can add a '&' at the end of the command line.
  1750.  
  1751.     Note: rback cannot start builtin commands. You have to start a
  1752.           subshell: rback csh -c "copy ram:temp prt:;rm ram:temp
  1753.  
  1754.     READFILE
  1755.  
  1756.     Usage    : readfile varname [filename]
  1757.  
  1758.     Completely reads an ASCII file and assigns it to a variable. Each
  1759.     line becomes one word in the resulting string. Embedded blanks
  1760.     are no problem. If file name is omitted, stdin is used. See also
  1761.     'writefile', @subfile and @flines
  1762.  
  1763.     REHASH
  1764.  
  1765.     Usage    : rehash [-cglos]
  1766.  
  1767.     Options :
  1768.      -c clear local program hash list
  1769.      -g clear global program hash list
  1770.      -l load global program hash list into local buffer
  1771.      -o output local program hash list
  1772.      -s save local program hash list to disk
  1773.  
  1774.     Scans the complete DOS search path (see also 'path') and builds a
  1775.     program hash list. This can be used for program name completion from
  1776.     command line (default: ESC-p, ESC-P). And when running commands
  1777.     CShell does not scan DOS search path any more for every command but
  1778.     instead scans the program hash list in memory (minimizes disk access
  1779.     and speeds up running commands significantly).
  1780.  
  1781.     Of course, when you add a directory to your path, when you add
  1782.     programs to the existing path or when you remove directories/programs
  1783.     then you have to rebuild the program hash list.
  1784.  
  1785.     Each invocation of CShell has its own local buffer to hold that
  1786.     program hash list.  Use option -s to save the local list to disk
  1787.     (csh:csh-prgs).  With option -l the list is loaded into memory.
  1788.     The first CShell loading the list puts a copy of it into a global
  1789.     buffer so that next time a CShell wants to load it the global buffer
  1790.     is used and not the disk file.
  1791.  
  1792.     The global list stays in memory -- even if you quit all CShells.
  1793.     Use option -g to free that global list (if you are low on memory),
  1794.     but this does not affect local lists of any currently running CShell.
  1795.     Option -c clears the local list.
  1796.  
  1797.     If you run this command without options the scanned list is not only
  1798.     put into local buffer but also in global buffer.
  1799.  
  1800.     There's no need to clear the local/global list before
  1801.     loading/building a new one. This is done automatically.
  1802.  
  1803.     The variable $_prghash (default: 'csh:csh-prgs') holds the filename
  1804.     where the program hash list is loaded from and saved to.
  1805.  
  1806.     Programs from the hash list are case in-sensitive and may be
  1807.     abbreviated. This can be toggled with the variable "_abbrev".
  1808.  
  1809.     Recommended usage:
  1810.     First run "rehash" from your shell to build the program hash list.
  1811.     Save this list to disk with "rehash -s".  Now include "rehash -l"
  1812.     in "s:.cshrc" to load this list on every invocation of CShell.
  1813.  
  1814.     RELABEL
  1815.  
  1816.     Usage    : relabel drive name
  1817.     Example    : relabel DH0: Picard
  1818.  
  1819.     Change the volume name of the disk in the given drive to the name
  1820.     specified. Volume names are set initially when you format a disk.
  1821.  
  1822.     If you have a floppy disk system with only one disk drive, be sure
  1823.     to specify the disks by volume name, instead of drive name.
  1824.  
  1825.     RENAME (or MV)
  1826.  
  1827.     Usage    : rename [-fv] from to
  1828.     or    : rename [-fv] from from from ... from todir
  1829.  
  1830.     Options :
  1831.      -f don't abort on errors
  1832.      -v verbose mode (print renamed filenames)
  1833.  
  1834.     Allows you to rename a file or move it around within a disk.
  1835.     Allows you to move 1 or more files into a single directory.
  1836.     The archive bit of the file(s) will be cleared.
  1837.  
  1838.  
  1839.     RESIDENT
  1840.  
  1841.     Usage    : resident [-dr] [files]
  1842.     Example    : resident lc1 lc2 blink    # load these as resident
  1843.           resident -d lc1 lc2 blink    # defer load when needed
  1844.           resident -r lc1 lc2 blink    # remove these
  1845.           resident            # list resident programs
  1846.  
  1847.  
  1848.     Options :
  1849.      -d deferred load;
  1850.      -r remove files from resident list
  1851.  
  1852.     This is DOS resident. Commands are searched by Shell in resident
  1853.     list BEFORE of searching on any external device.
  1854.     Only PURE programs can run as resident, see DOS docs for more info.
  1855.     Option -d is very useful: you can say, in your startup file,
  1856.     resident -d file...file; programs will not be loaded immediately,
  1857.     but only when you will try to load them. This way, you will not
  1858.     waste memory and startup time if you don't use the programs.
  1859.     Old option -a has no more effect.
  1860.  
  1861.     RETURN
  1862.  
  1863.     Usage    : return [n]
  1864.     Example    : return 10
  1865.  
  1866.     Exit from a script file, or quit from shell with optional
  1867.     exit code.
  1868.  
  1869.     RM (or DELETE)
  1870.  
  1871.     Equivalent to DELETE.
  1872.  
  1873.     RPN
  1874.  
  1875.     Usage    : rpn expression
  1876.     Example    : rpn 3 7 *    # Prints the value 21
  1877.  
  1878.     Evaluate an RPN expression, using 32-bit values. In older versions
  1879.     of Shell RPN contained string functions too, but now that strings
  1880.     are handled by specifical commands, these are no more needed.
  1881.     At end of evaluation, RPN prints values on stack, so you can
  1882.     say for instance "rpn $x 2 * | input x" to double the value of
  1883.     variable x.
  1884.     Functions implemented are:
  1885.  
  1886.         + - * /    Obvious meaning; / means integer division, of course
  1887.         %        Module operator e.g. "rpn 7 3 %" answers 1
  1888.         & | ~    Bitwise and, or, not operators
  1889.         > < ==    Tests for greater-than, lower-than, equal. To get
  1890.             a test for >= (or <=), you can use < ! (or > !)
  1891.         !        Logical not operator
  1892.         DUP        Duplicate value on top of stack
  1893.         DROP    Drop value on top of stack
  1894.         SWAP    Swap two values on top of stack
  1895.  
  1896.     To avoid confusion with redirections, > and < operators must be
  1897.     enclosed in quotes e.g.
  1898.  
  1899.         3 2 ">"        # Prints 1
  1900.  
  1901.     RUN
  1902.  
  1903.     Usage    : run prgm args
  1904.     Example    : run emacs test.c
  1905.  
  1906.     Start a new process executing the specified command. This command is
  1907.     not fully reliable: use at your own risk.  See also rback.
  1908.  
  1909.     RXREC
  1910.  
  1911.     Usage    : rxrec [portname]
  1912.  
  1913.     Create an AREXX-compatible port of the specified name (defaults to
  1914.     "rexx_csh"), then puts Shell to sleep waiting for messages on it.
  1915.  
  1916.     CAUTION: the only way to exit from this status is to send to the
  1917.     port the message "bye".
  1918.  
  1919.     Example:
  1920.     Open two Shell's in two separate CLI's. From the first, type:
  1921.  
  1922.         rxrec
  1923.  
  1924.     Now first Shell doesn't respond to keyboard input; instead, it waits
  1925.     for messages on a port called "rexx_csh". Now, from the other, type:
  1926.  
  1927.         rxsend rexx_csh "dir df0:"
  1928.  
  1929.     You will see the listing of df0: in the first Shell.  Experiment as
  1930.     you like, then:
  1931.  
  1932.         rxsend rexx_csh bye
  1933.  
  1934.     And all will return to normal.
  1935.  
  1936.     RXSEND
  1937.  
  1938.     Usage    : rxsend [-lr] portname command...command
  1939.  
  1940.     Options :
  1941.      -r set the variable _result to the result string of the
  1942.         AREXX command.
  1943.      -l send the whole line as *one* command.
  1944.  
  1945.     Send commands to any program with an AREXX-compatible port. Be aware
  1946.     that every word is sent as a single command!
  1947.  
  1948.     You don't have to load anything to use these command (or rxrec):
  1949.     all you need is a program with the right port.
  1950.  
  1951.     An example is CygnusEdProfessional: here is, for instance, a command
  1952.     to wake it up, load the file test.c and jump to line 20:
  1953.  
  1954.         rxsend rexx_ced cedtofront "open test.c" "jmp to line 20"
  1955.         # rexx_ced is the name of AREXX port for CygnusEd
  1956.  
  1957.  
  1958.     Refer to your application manual for details and for the names
  1959.     of the commands and the port.
  1960.  
  1961.     SEARCH
  1962.  
  1963.     Usage    : search [-abceflnoqrvw] file...file string
  1964.  
  1965.     Search specified files for a string. Only lines containing the
  1966.     specified strings are displayed.
  1967.  
  1968.     If the filename is STDIN (in uppercase), the standard input is
  1969.     used, so you can use search as the destination for a pipe.
  1970.     Example:
  1971.         strings myprog * | search STDIN .library
  1972.     Lists all libraries used in "myprog".
  1973.  
  1974.     Search is very fast if none of the options -w, -e and STDIN was
  1975.     specified and the file fits into memory.
  1976.  
  1977.     Options:
  1978.       -a (abort)   stops search as soon as the pattern was found once
  1979.       -b (binary)  shows only byte offsets instead of lines. If combined
  1980.                    with -n, shows naked numbers.
  1981.       -c (case)    turns ON case sensitivity
  1982.       -e (exclude) lists lines NOT containing the pattern
  1983.       -f (files)   causes only the names of the files in which the pat-
  1984.                    tern was found to be displayed.
  1985.       -l (left)    pattern must be at beginning of line (this is faster
  1986.                    than using a wild card)
  1987.       -n (number)  turns off line numbering
  1988.       -o (only)    finds only whole words
  1989.       -q (quiet)   suppresses printing of file names.
  1990.       -r (recurse) if you specify any directory, all files in that di-
  1991.                    rectory are recursively searched.
  1992.       -v (verbose) shows each file name on a single line. this is auto-
  1993.                    matically turned on if search is redirected
  1994.       -w (wild)    wild card matching. see notes below
  1995.  
  1996.     Notes to wild card matching;
  1997.     - Uses Shell standard matching.
  1998.     - All standard DOS wildcards are allowed * ? [] () | ~ ' #
  1999.     - The WHOLE line must match the string, not only a substring.
  2000.     - String MUST be enclosed in quotes to avoid wildcard expansion
  2001.  
  2002.     Examples:
  2003.         search -cr df0:include ACCESS
  2004.     Find all occurrences of ACCESS (in uppercase) in all files
  2005.     contained in include directory.
  2006.         search -w shell.h "'#define*"
  2007.     Lists only lines of file beginning with (not simply containing)
  2008.     #define. Note the use of ' to escape the special symbol #.
  2009.  
  2010.     SET
  2011.  
  2012.     Usage    : set [name] [=] [string]
  2013.     Example    : set abc hello
  2014.  
  2015.     Set with no args lists all current variable settings.
  2016.     Set with one arg lists the setting for that particular variable.
  2017.     Specifying name and string, stores the string into variable name.
  2018.  
  2019.     Also see the section on special _variables.
  2020.  
  2021.     SETENV
  2022.  
  2023.     Usage    : setenv envvar value
  2024.  
  2025.     Sets an ENV: variable to the given value. The value must be
  2026.     enclosed in quotes if it contains spaces. To retrieve an ENV:
  2027.     variable, just use $envvar anywhere on a command line.
  2028.  
  2029.     SLEEP
  2030.  
  2031.     Usage    : sleep timeout
  2032.     Example    : sleep 10
  2033.  
  2034.     Sleep for 'timeout' seconds, or until ^C typed.
  2035.  
  2036.     SOURCE
  2037.  
  2038.     Usage    : source file [arguments]
  2039.     Example    : source mymake.sh all
  2040.     Result    : batch file 'mymake.sh' called with var _passed = 'all'
  2041.  
  2042.     Execute commands from a file.  You can create SHELL programs in
  2043.     a file and then execute them with this command.  Source'd files
  2044.     have the added advantage that you can have loops in your command
  2045.     files (see GOTO and LABEL).  You can pass SOURCE files arguments
  2046.     by specifying arguments after the file name.  Arguments are passed
  2047.     via the _passed variable (as a single string, a set of words).
  2048.     See _failat variable for script aborting.
  2049.  
  2050.     Long lines may be split by appending a backslash (\) at end of
  2051.     first part. One single line must be shorter than 512 bytes, but
  2052.     the concatenated line can be as long as you want. There is no
  2053.     limit on the length of the concatenated line.
  2054.  
  2055.     Automatic 'sourcing' is accomplished by appending a .sh suffix to
  2056.     the file (no need to set the s-bit) and executing it as you would
  2057.     a C program:
  2058.  
  2059.     --------- file hello.sh ---------
  2060.     foreach i ( $_passed ) "echo yo $i"
  2061.     ---------------------------------
  2062.  
  2063.     $ hello a b c
  2064.     yo a
  2065.     yo b
  2066.     yo c
  2067.  
  2068.     If the last character of a line in a source file is '{', all
  2069.     following lines will appended to the current one and separated
  2070.     by semicolons until the last character of a line is '}'. Those
  2071.     blocks may be nested. You may use comments and unterminated
  2072.     strings within.
  2073.  
  2074.     --------- file login.sh ---------
  2075.     alias complex {
  2076.       echo -n "this alias
  2077.       echo " works!"
  2078.     }
  2079.     ---------------------------------
  2080.  
  2081.     $ login
  2082.     $ complex
  2083.     this   alias   works!
  2084.  
  2085.     SPLIT
  2086.  
  2087.     Usage    : split srcvar dstvar...dstvar
  2088.  
  2089.     Assigns one word of srcvar to every dstvar, the rest of srcvar to
  2090.     the last dstvar.
  2091.     Note: You enter variable NAMES, not variables.
  2092.  
  2093.     STACK
  2094.  
  2095.     Usage    : stack [number]
  2096.     Example    : stack [-s] 8000
  2097.  
  2098.     Options :
  2099.      -s prints size only (pure number, no text).
  2100.  
  2101.     Changes the default stack for this CLI.
  2102.     Without arguments, just prints it.
  2103.  
  2104.     STRHEAD
  2105.  
  2106.     Usage    : strhead varname breakchar string
  2107.     Example    : strhead x "." foobar.bas    # Will set x to "foobar",
  2108.                                           # . must be quoted!
  2109.  
  2110.     Remove everything after and including the breakchar in 'string' and
  2111.     place in variable 'varname'. See also command "STRTAIL".
  2112.  
  2113.     STRINGS
  2114.  
  2115.     Usage    : strings [-bnrv] [file1..fileN] [minlength]
  2116.     Example    : strings [-bnrv] c:dir c:list shell 7
  2117.  
  2118.     Options :
  2119.      -r  if you specify any directory, all files in that directory
  2120.          are recursively searched for strings
  2121.      -n  print name of current file in front of each string
  2122.      -b  shows each string enclosed by  '|' characters, so as to expose
  2123.          leading and trailing spaces or tabs.
  2124.      -v  verbose output before each file (filename, minlength)
  2125.  
  2126.     Prints strings contained in specified files (usually binary)
  2127.     with length >= minlength.  Default is 4.
  2128.  
  2129.     You cannot use a filename that represents a number as last
  2130.     argument. If there are no filenames specified, standard input
  2131.     is used, so you can use strings as the destination for a pipe.
  2132.  
  2133.     STRLEFT
  2134.  
  2135.     Usage    : strleft varname string n
  2136.     Example    : strleft x LongString 5    # Will set x to "LongS"
  2137.  
  2138.     Place leftmost n chars of string in variable varname.
  2139.  
  2140.     STRLEN
  2141.  
  2142.     Usage    : strlen varname string
  2143.     Example    : strlen x Hello        # Will set x to "5"
  2144.  
  2145.     Puts len of string in variable varname.
  2146.  
  2147.     STRMID
  2148.  
  2149.     Usage    : strmid varname string n1 [n2]
  2150.     Example    : strmid x LongString 5 3    # Will set x to "Str"
  2151.  
  2152.     Places n2 chars from string, starting at n1, in variable varname.
  2153.     By omitting n2, you get all chars from n1 to end of string.
  2154.  
  2155.     STRRIGHT
  2156.  
  2157.     Usage    : strright varname string n
  2158.     Example    : strright x LongString 5    # Will set x to "tring"
  2159.  
  2160.     Place rightmost n chars of string in variable varname.
  2161.  
  2162.     STRTAIL
  2163.  
  2164.     Usage    : strtail varname breakchar string
  2165.     Example    : strtail x "." foobar.bas    # Will set x to "bas",
  2166.                                           # . must be quoted!
  2167.  
  2168.     Remove everything before and including the breakchar in 'string' and
  2169.     place in variable 'varname'. See also command "STRHEAD".
  2170.  
  2171.     TACKON (or ADDPART)
  2172.  
  2173.     Usage    : tackon var pathname filename
  2174.     Example    : tackon x df0:c Dir    # sets x to "df0:c/Dir"
  2175.     or    : tackon x df0: Preferences #sets x to "df0:Preferences"
  2176.  
  2177.     Correctly  adds  a  filename  to a pathname, and puts the result in
  2178.     variable specified.
  2179.  
  2180.     TAIL
  2181.  
  2182.     Usage    : tail [filename] [num]
  2183.     Example    : tail readme 20
  2184.  
  2185.     Display last "num" lines of "filename".    If num is not specified,
  2186.     10 is assumed. If filename is not specified, standard input (stdin)
  2187.     is taken instead.
  2188.  
  2189.     TEE
  2190.  
  2191.     Usage    : tee [file]
  2192.     Example    : cc test.c | tee >error.list
  2193.  
  2194.     Copies stdin to stdout and the given file.
  2195.     If file is omitted, stderr is used.
  2196.  
  2197.     TOUCH
  2198.  
  2199.     Usage    : touch file1 .. fileN
  2200.  
  2201.     Sets DateStamp of the specified files to the current date & resets
  2202.     archive bit.
  2203.  
  2204.     If a file doesn't exist, touch will create an empty one for you.
  2205.  
  2206.     TRUNCATE
  2207.  
  2208.     Usage    : truncate [n]
  2209.     Example : alias | qsort | truncate
  2210.  
  2211.     A filter that truncates the width of stdin to the specified number,
  2212.     trying to account for tab's and escape sequences. If the number is
  2213.     omitted, the current window width is used.
  2214.  
  2215.     TYPE (or CAT)
  2216.  
  2217.     Equivalent to CAT.
  2218.  
  2219.     UNALIAS
  2220.  
  2221.     Usage    : unalias name .. name
  2222.     Example    : unalias vt
  2223.  
  2224.     Delete aliases..
  2225.  
  2226.     UNIQ
  2227.  
  2228.     Usage    : uniq
  2229.  
  2230.     This is a  filter that removes consecutive, duplicated lines in a
  2231.     file.  It is most useful on a sorted file.
  2232.  
  2233.     UNSET
  2234.  
  2235.     Usage    : unset name .. name
  2236.     Example    : unset abc
  2237.  
  2238.     Unset one or more variables.  Deletes them entirely.
  2239.  
  2240.     USAGE
  2241.  
  2242.     Usage    : usage [command...command]
  2243.  
  2244.     If called without arguments, usage gives you a short information
  2245.     on the special characters used. Otherwise, usage shows you the
  2246.     usage of the given commands. Calling a command with a '?' as
  2247.     the only argument will show its usage, too.
  2248.  
  2249.     VERSION
  2250.  
  2251.     Usage    : version
  2252.  
  2253.     Show current version name, & authors.
  2254.  
  2255.     WAITFORPORT
  2256.  
  2257.     Usage    : waitforport portname [seconds]
  2258.     Example    : waitforport rexx_ced 5
  2259.  
  2260.     Waits for a port to come up. Default time is 10 seconds.
  2261.  
  2262.     WHEREIS
  2263.  
  2264.     Usage    : whereis [-r] filename [ device1...deviceN ]
  2265.  
  2266.  
  2267.     Options    :
  2268.      -r look on all drives.
  2269.  
  2270.     If just a file name is given, whereis searches all subdirectories of
  2271.     the current directory for that file. An asterisk '*' is appended to
  2272.     the file. Wild cards are allowed for the file (no asterisk will be
  2273.     appended then), but no path names. If additional arguments are
  2274.     given, whereis searches only these paths, not the current directory.
  2275.  
  2276.     WINDOW
  2277.  
  2278.     Usage    : window [-fblsaq] [dimensions]
  2279.  
  2280.     Options    :
  2281.         -f    (front) Window to front
  2282.         -b    (back)  Window to back
  2283.         -l    (large) Window to maximum size
  2284.         -s    (small) Window to minimum size
  2285.         -a    (activate)
  2286.         -q    (query) Lists screens and windows open
  2287.         -w    (width) Ignore window width for option "-q" (query)
  2288.  
  2289.     Various operations on CLI window. If dimensions are specified,
  2290.     they must be in the form x y width height, with values separated by
  2291.     spaces. Use dimension -1 for maximum value (eg, "window -1 -1 -1 -1"
  2292.     is equivalent to "window -l"), and -2 for keeping current value.
  2293.  
  2294.     The command "window -l" may be very useful on PAL machines to get
  2295.     a full PAL window from your login sequence, or if you use overscan
  2296.     WorkBench.
  2297.  
  2298.     Option -q gives, for each Screen and Window currently open,
  2299.     title, left edge, top edge, width, height, (depth).
  2300.  
  2301.     WRITEFILE
  2302.  
  2303.     Usage: writefile varname
  2304.  
  2305.     Writes a set of words to stdout, one word per line. Note that the
  2306.     name of the variable (var) must be supplied, not the value ($var).
  2307.  
  2308.  
  2309. IX. SPECIAL VARIABLES
  2310. ---------------------
  2311.  
  2312. There are a number variables, the write variable, that have a side effect on
  2313. your system (e.g.  changing the title bar), and some others, the read
  2314. variables, that tell you something about your environment (e.g.  the current
  2315. shell version).  You can also overlay the write variables with a local
  2316. variable, so any change only takes place while the current context is
  2317. valid.
  2318.  
  2319. LIST OF VARIABLES:
  2320. ------------------
  2321.  
  2322.     _abbrev
  2323.     Holds a number which lets you select the various modes of
  2324.     command-abbreviation:
  2325.  
  2326.       0   internal commands and commands buffered with "rehash"
  2327.           can no longer be abbreviated  (same as "unset _abbrev")
  2328.       1   internal commands can be abbreviated
  2329.       2   commands buffered with "rehash" can be abbreviated,
  2330.           the first (partially) matching command from the list is taken
  2331.       4   commands buffered with "rehash" can be abbreviated,
  2332.           if the command matches a buffered command completely,
  2333.           then this is taken, else the first partially matching
  2334.           command from the list is taken
  2335.       8   if command wasn't found in Cshell's internal program list
  2336.           (built with "rehash"), then search DOS path-list
  2337.  
  2338.     Numbers can be added to combine modes.
  2339.  
  2340.     The main difference between '2' and '4' is that '2' does not
  2341.     recognize a completely matching command if it has already
  2342.     found a partially matching command earlier in the list.  Eg,
  2343.     you type "ed" and you have (in this order) "EdPlayer" and
  2344.     "Ed" in your list, then "Ed" can never be called (except with
  2345.     absolute path). So '4' first seeks for a completely matching
  2346.     command -- and if it cannot find anything then (and only then)
  2347.     it searches for an abbreviated command.
  2348.  
  2349.     Thus it makes obviously no sense to use '2' and '4' together.
  2350.  
  2351.     By default, this variable is set to '5' (1+4).
  2352.  
  2353.     _bground
  2354.     True if the shell was started with a non-interactive input.
  2355.  
  2356.     _clinumber
  2357.     Contains the number (1-20) of current CLI.
  2358.  
  2359.     _clipri
  2360.     Task priority while editing command line.
  2361.     (also affects filename completion)
  2362.  
  2363.     _complete
  2364.     This variable holds a DOS pattern. What files should match on
  2365.     filename completion. Default is "*" (show all files). For example,
  2366.     if you don't want to see files ending with ".o" and ".bak", set it
  2367.     to "~(*.o|*.bak)".
  2368.  
  2369.     _cquote
  2370.     If set to some value, quotation marks are handled as
  2371.     Commodore-Shell does, so that they are parsable by ReadArgs()
  2372.     (function call in dos.library). Commodore-Shell treats quotes
  2373.     within a string "as as". Only leading quotation marks "quote"
  2374.     other special chars (like spaces). In contrast to UNIX shells
  2375.     where quotation marks always "quote" other chars - regardless
  2376.     of their position. UNIX behavior (_cquote unset) is default.
  2377.  
  2378.     _cwd
  2379.     Holds a string representing the current directory we are in from
  2380.     root.  The SHELL can get confused as to its current directory if
  2381.     some external program changes the directory.  Use PWD to rebuild
  2382.     the _cwd variable in these cases.
  2383.  
  2384.     _debug
  2385.     Debug mode... use it if you dare.  must be set to some value
  2386.  
  2387.     _dirformat
  2388.     Holds a format string for option -z of builtin command "dir".
  2389.     Used to keep aliases short and to bypass problems with dir's
  2390.     format option "-z" (eg, it's not possible to specify other options
  2391.     after -z without using @pickargs/@pickopts).
  2392.  
  2393.     The format string is limited to a maximum of 80 characters.
  2394.  
  2395.     _every
  2396.     Contains the name of a command that is to be executed every time
  2397.     just before the prompt is printed. Do not use this to echo the
  2398.     prompt.
  2399.  
  2400.     _except
  2401.     See EXCEPTION
  2402.  
  2403.     _failat
  2404.     If a command returns with an error code higher than this, the
  2405.     batch file aborts. The default is 20.
  2406.  
  2407.     _hilite
  2408.     Holds the font attributes used for highlighting. One letter for one
  2409.     attribute:
  2410.       b    for bold
  2411.       i    for italic
  2412.       u    for underlined
  2413.       r    for reverse
  2414.       c3   for foreground color 3
  2415.       c3,2 for foreground color 3 and background color 2
  2416.     Any combinations are allowed. _hilite defaults to "c7", in terminal
  2417.     mode to "r".
  2418.  
  2419.     _history
  2420.     This variable is set to a numerical value, and specifies how far
  2421.     back your history should extend. Set it to 0 to disable history,
  2422.     for example if you test your programs for memory leaks. Defaults
  2423.     to 50.
  2424.  
  2425.     _insert
  2426.     Sets the default for insert/overtype mode for command line editing.
  2427.     ESC-i toggles between, but after <RET> the default is set back as
  2428.     indicated by this variable. By default _insert is 1, unsetting
  2429.     _insert will make overtype the default.
  2430.  
  2431.     _ioerr
  2432.     Contains the secondary error code for the last command. Will be
  2433.     changed after every external command and after a failed internal
  2434.     command. See @ioerr( )
  2435.  
  2436.     _kick
  2437.     holds version number of Operating System (version.library),
  2438.     eg, 37, 38, 39, 40, ...
  2439.  
  2440.     _kick2x
  2441.     True if exec.library V37+ could be opened
  2442.     (which means that kickstart 2.0 is around)
  2443.  
  2444.     _kick3x
  2445.     True if exec.library V39+ could be opened
  2446.     (which means that kickstart 3.0 is around)
  2447.  
  2448.     _lasterr
  2449.     Return code of last command executed.  This includes internal
  2450.     commands as well as external comands, so to use this variables
  2451.     you must check it IMMEDIATELY after the command in question.
  2452.  
  2453.     _lcd
  2454.     Holds the name of the last directory. The builtin alias 'dswap'
  2455.     cd's to that directory. If called again, you're back where you
  2456.     were.
  2457.  
  2458.     _man
  2459.     The path and name of your .doc files. Defaults to 'csh:csh.doc'
  2460.  
  2461.     _mappath
  2462.     Cshell allows invocation of foreign shells if a script starts with
  2463.     "#!" or ";!" followed by a command to execute.  To use unmodified
  2464.     Unix scripts pathname-mapping is necessary to convert pathes like
  2465.     "/usr/..." to, eg, "usr:...".  Set _mappath to enable this name-
  2466.     mapping.  By default _mappath is unset ("/usr/" would be inter-
  2467.     preted as relative AmigaDOS path).
  2468.  
  2469.     _maxerr
  2470.     The worst (highest) return value to date.  To use this, you usually
  2471.     set it to '0', then do some set of commands, then check it.
  2472.  
  2473.     _minrows
  2474.     Gives the minimum number of rows a window must have to turn on quick
  2475.     scrolling. Defaults to 34.
  2476.  
  2477.     _nobreak
  2478.     If set to some value, disables CTRL-C.
  2479.  
  2480.     _nomatch
  2481.     If set to some value, don't check patterns if they match.
  2482.     (By default CSH aborts command execution if all patterns does not
  2483.      match. If at least one pattern matches CSH does not abort.)
  2484.  
  2485.     _noreq
  2486.     If set to some value, disables system requesters ("Please insert
  2487.     volume ...."). Turned on in vt200 mode.
  2488.  
  2489.     _passed
  2490.     This variable contains the passed arguments when you SOURCE a file
  2491.     or execute a .sh file.  For instance:
  2492.  
  2493.     test a b c d
  2494.  
  2495.     -------- file test.sh ----------
  2496.     echo $_passed
  2497.     foreach i ( $_passed ) "echo YO $i"
  2498.     --------------------------------
  2499.  
  2500.     _path
  2501.     Tells CShell where to look for executable files. The current direc-
  2502.     tory and the AmigaDOS path will be searched first. The trailing
  2503.     slash for directories is not necessary any more.  The entire path
  2504.     will be searched first for the <command>, then for <command>.sh
  2505.     (automatic shell script sourcing). Example:
  2506.         set _path ram:c,ram:,sys:system,dh1:tools,df0:c
  2507.     (This path has the advantage that these directories need not even
  2508.      exist, that you can access devices (AmigaDOS path only knows
  2509.      volumes under Kick 1.3) and that no disk seeks happen at startup)
  2510.  
  2511.     The usage of _path is NOT recommended anymore, use the AmigaDOS
  2512.     search path instead (builtin command "path").
  2513.  
  2514.     _prghash
  2515.     The filename where the program hash list (command 'rehash')
  2516.     is loaded from and saved to.
  2517.  
  2518.     _prompt
  2519.     This variable now can contain the following control characters:
  2520.      %c  for color change. This highlights your prompt. See _hilite
  2521.      %e  for elapsed time. The time the last command took to execute.
  2522.      %m  for memory. This shows your current memory in K
  2523.      %t  for time. This shows your current time in the format HH:MM:SS
  2524.      %d  for date. This shows the current date in the format DD-MMM-YY
  2525.      %p  for path. This inserts the complete current path
  2526.      %P  for path. This inserts the current path (see also _promptdep)
  2527.      %V  for volume. This inserts the current volume
  2528.      %n  for number. This inserts the current process number
  2529.      %v  for version. This shows the version number of CShell
  2530.      %h  for history. This displays the current history number
  2531.      %f  for free store. This shows the free store on the current drive
  2532.      %r  for pRiority. Inserts the task priority of the current
  2533.      %s  for shells open. Inserts the result of 'howmany'
  2534.      %U  for user. Shows current user (only with "MultiUser" package)
  2535.      %x  for external cmd return code. Yields the last error code
  2536.     The default for prompt is now "%c%p> "
  2537.     The  if  command  will  set the prompt to a '_ ' if commands are
  2538.     disabled while waiting for a 'endif' or 'else' command (interactive
  2539.     mode only).
  2540.  
  2541.     _promptdep
  2542.     Prompt path depth. Holds the maximum number of directories (path
  2543.     parts counting from the right) displayed for "%P" (see _prompt) to
  2544.     keep prompt smart and short. _promptdep must be greater 0.
  2545.     The internal default for "%P" is to display 3 directories.
  2546.  
  2547.     _pipe
  2548.     The directory where temporaries are stored. Default: 'T:'
  2549.  
  2550.     _qcd
  2551.     Holds the name of the file where the all directories on your hard
  2552.     disk are stored. If not set, disables quick cd-ing.
  2553.  
  2554.     _rback
  2555.     Is the name of the command to be the prepended to the command line
  2556.     when '&' was added to it. Defaults to 'rback', can't be a multi
  2557.     word command yet.
  2558.  
  2559.     _rxpath
  2560.     The same as with _path, but this is where CShell looks for .rexx
  2561.     files. Defaults to REXX:
  2562.  
  2563.     _scroll
  2564.     Holds the number of lines to be scrolled at once when quick
  2565.     scrolling is used. If unset or <=1, quick scrolling is off.
  2566.     Defaults to 3.
  2567.  
  2568.     _terminal
  2569.     Indicates whether or not shell was started in terminal mode.
  2570.  
  2571.     _timeout
  2572.     Set the timeout period (in microsends) for the connected terminal to
  2573.     respond to a WINDOW STATUS REQUEST (special Amiga control sequence
  2574.     to get window bounds). Only used in terminal mode, of course.
  2575.  
  2576.     For local usage a small value is sufficient, for remote usage (eg,
  2577.     over a serial line) the value should be much higher (eg, 500000,
  2578.     which a 1/2 second).
  2579.  
  2580.     _titlebar
  2581.     The same control characters as for the _prompt can be used for
  2582.     _titlebar, too. The only difference is that %c is ignored. The
  2583.     titlebar is updated every time before the prompt appears.
  2584.  
  2585.     _verbose
  2586.     If set to 's', turns on verbose mode for source files (every command
  2587.     will be displayed before being executed). If set to 'a', displays
  2588.     all substeps while alias substitution. 'h' will hilight the debug
  2589.     output. Any combination allowed: set _verbose sah
  2590.  
  2591.     _version
  2592.     Contains the version number of the shell, e.g. 510.
  2593.  
  2594.  
  2595. X.   FUNCTIONS
  2596. --------------
  2597.  
  2598.     FUNCTIONS
  2599.     Functions are preceded by an @-sign and may not be abbreviated
  2600.     They must be preceded by a blank and a blank must follow the opening
  2601.     and precede the closing parenthesis. There must be no blank between
  2602.     the function name an the opening parenthesis. Example:
  2603.        echo @info( df0: )
  2604.     (NOTE: Later versions of Shell might allow that functions need not
  2605.            be at the beginning of an argument, so quote any @-signs not
  2606.            used for functions)
  2607.  
  2608.     Functions may be nested. The function names themselves are case
  2609.     sensitive, but the operations (like strcmp) aren't.
  2610.  
  2611.     Functions can be used as commands. They will echo their return value
  2612.     to stdout. Note that they can't be abbreviated and that the function
  2613.     list is searched after the command list. Example:
  2614.         drives          ---> DF0: DH1: DH2: RAM: WB_2.x:
  2615.     Therefore, functions can also be used like this:
  2616.         echo $(drives)
  2617.  
  2618.     So far, functions are not user definable.
  2619.  
  2620.     Note the difference between sets of words and strings. After
  2621.       set var hello world
  2622.     $var is a wordset, but after
  2623.       set var "hello world"
  2624.     var is one string. Although they look the same if echoed, they
  2625.     behave different, for example in 'foreach i ( var ) "echo hi'. The
  2626.     functions @split and @concat convert the two forms.
  2627.  
  2628.  
  2629. LIST OF FUNCTIONS:
  2630. ------------------
  2631.  
  2632.     @abbrev( str1 str2 [len] )
  2633.     true if the first <len> chars of str1 are an abbreviation of str2
  2634.     @abs( num )
  2635.     returns absolute value of <num>
  2636.     @age( file )
  2637.     the age of that file in days, null-string if file not found
  2638.     @age_mins()
  2639.     the age of that file in minutes, null-string if file not found
  2640.     @appsuff( name suffix )
  2641.     appends an suffix ( .ZOO ) to a string if it's not already there
  2642.     @arg( arg ... arg )
  2643.     see @pickargs( )
  2644.     @ask( title item ... item )
  2645.     asks for confirmation of every item and returns the confirmed ones
  2646.     (very similar to @confirm(), but default is negative)
  2647.     @availmem( [type] )
  2648.     returns free 'chip', 'fast' or otherwise total memory
  2649.     @basename( path ... path )
  2650.     returns the file name parts of the paths
  2651.     @center( word len )
  2652.     returns a string of length <len> with <word> centered in it
  2653.     @checkport( portname )
  2654.     indicates if given port exists
  2655.     @clinum( procname )
  2656.     returns the number of the cli identified by a name or a number
  2657.     @complete( abbrev word ... word )
  2658.     returns the first word <abbrev> is an abbreviation of
  2659.     @concat( word word ... word )
  2660.     concats all words in one blank separated string, see @split
  2661.     @confirm( title item ... item )
  2662.     asks for confirmation of every item and returns the confirmed ones
  2663.     (very similar to @ask(), but default is positive)
  2664.     @console( STDIN|STDOUT )
  2665.     tells whether stdin or stdout are interactive (not redirected)
  2666.     @dectohex( number )
  2667.     returns a string representing <number> in hex
  2668.     @delword( word word ... word n )
  2669.     returns a string with the n-th word deleted.
  2670.     @delwords( word word ... word n m )
  2671.     deletes the next m words from the n-th.
  2672.     @dirname( path )
  2673.     strips the base name from a path, just returns the directory
  2674.     @dirs( name name name name )
  2675.     returns the directories among the given file names, see @files
  2676.     @dirstr( lformat file )
  2677.     returns any info (size, date, file comment) about a file
  2678.     @drive( path )
  2679.     outputs the drive ( device ) name associated to <path>
  2680.     @drives( )
  2681.     outputs all available drives
  2682.     @exists( file )
  2683.     tells whether a file exists or not
  2684.     @fileblks( file file ... file )
  2685.     returns the # of blocks needed for the files, incl. dir blocks
  2686.     @filedate( file )
  2687.     returns a string representing the date of the given file
  2688.     @fileinfo
  2689.     Equivalent to @dirstr
  2690.     @filelen( file file ... file )
  2691.     count the total number of bytes of the given files
  2692.     @filenote( file )
  2693.     returns filenote of given file
  2694.     @fileprot( file )
  2695.     returns a string like ---arwed
  2696.     @filereq( title path&pattern filename )
  2697.     brings up the ASL file requester and returns the selected file name
  2698.     @files( file file ... file )
  2699.     gives you the files among those names, no directories. see @dirs
  2700.     @filesize
  2701.     Equivalent to @filelen
  2702.     @flines( varname )
  2703.     counts the number of lines in a readfile-file (faster than @words)
  2704.     @freebytes( path )
  2705.     the number of free bytes on the given path
  2706.     @freeblks( path )
  2707.     the number of free blocks on the given path
  2708.     @freestore( path )
  2709.     the amount of free store on that path, given in K, M and G
  2710.     @getenv( varname )
  2711.     returns the value of the named env: variable
  2712.     @getclass( file )
  2713.     returns the class (type) of the file. See chapter XIV
  2714.     @hextodec( hex-number )
  2715.     returns a string representing <hex-number> in dec
  2716.     @howmany( )
  2717.     indicates the # of shells running
  2718.     @index( string pattern )
  2719.     returns the index of pattern in string (starting at 1),
  2720.     0 if not found
  2721.     @info( path )
  2722.     the corresponding line from the 'info' command, each entry a word
  2723.     @intersect( word1 word2 word3 , word4 word5 word6 )
  2724.     returns all words which are in both lists. see @union, @member
  2725.     @ioerr( num )
  2726.     returns the corresponding error string to num
  2727.     @lookfor( file paths )
  2728.     looks for a file in the current directory and the paths. See $_path
  2729.     @lower
  2730.     lowercases its arguments. see @upper
  2731.     @match( word ... word "pattern" )
  2732.     returns the words in the list that match the DOS-pattern
  2733.     @max( num num ... num )
  2734.     computes the maximum of all given numbers
  2735.     @megs( number )
  2736.     expresses a number in K, M and G (-bytes), rounded correctly
  2737.     @member( word1 word word ... word )
  2738.     tells you if word1 is among the remaining words
  2739.     @min( num num ... num )
  2740.     computes the minimum of all given numbers
  2741.     @mix( arg1 ... argn )
  2742.     randomly mixes its arguments
  2743.     @mounted( device )
  2744.     returns a boolean indicating whether the specified device is mounted,
  2745.     (don't add an extra colon ':' at the end)
  2746.     @nameext( filename )
  2747.     returns all after the last dot of <filename>.
  2748.     @nameroot( filename )
  2749.     returns all before the LAST dot of <filename>.
  2750.     @opt( arg ... arg )
  2751.     see @pickopts( )
  2752.     @pathname( path )
  2753.     obsolete. use @dirname
  2754.     @pickargs( arg ... arg )
  2755.     picks of its arguments those which don't start with a '-'
  2756.     @pickopts( arg ... arg )
  2757.     picks of its arguments those which start which a '-'
  2758.     @rnd( seed )
  2759.     returns a 32 bit random number (default seed is 1);
  2760.     'seed' is optional and can be used to set new seed for @rnd( ),
  2761.     if you use seed=0 then CSH takes current system time as seed
  2762.     @rpn( expression )
  2763.     computes the rpn expression. See rpn command
  2764.     @scrheight( )
  2765.     outputs the current height of the screen the shell is running in
  2766.     @scrwidth( )
  2767.     outputs the current width of the screen the shell is running in
  2768.     @sortargs( name ... name )
  2769.     sorts its arguments alphabetically
  2770.     @sortnum( number ... number )
  2771.     sorts its arguments numerically
  2772.     @split( string )
  2773.     makes each blank separated part of @string a word, see @concat
  2774.     @strcmp( name name )
  2775.     returns -1, 0 or 1 depending of alphabetical comparison
  2776.     (case-sensitive)
  2777.     @stricmp( name name )
  2778.     returns -1, 0 or 1 depending of alphabetical comparison
  2779.     (case-insensitive)
  2780.     @strhead( breakchar string )
  2781.     see strhead command
  2782.     @strleft( string number )
  2783.     see strleft command
  2784.     @strmid( string n1 n2 )
  2785.     see strmid command
  2786.     @strright( string n )
  2787.     see strright command
  2788.     @strtail( breakchar string )
  2789.     see strtail command
  2790.     @subfile( varname n m )
  2791.     like @subwords, but acts on a readfile-file and is faster
  2792.     @subwords( word ... word n m )
  2793.     returns the next m words word of the given list starting from n
  2794.     @tackon( path file )
  2795.     see tackon command
  2796.     @trim( word word word )
  2797.     removes all leading and trailing blanks from the words
  2798.     @unique( word ... word )
  2799.     sorts the arguments and makes each of them unique
  2800.     @union( name ... name , name ... name )
  2801.     returns all names that are in either list. See @intersect, @member
  2802.     @upper( word ... word )
  2803.     upper cases the given words. see @lower
  2804.     @volume( path )
  2805.     returns the volume name in that path or ""
  2806.     @wincols( )
  2807.     returns the number of columns in the current shell window
  2808.     @winheight( )
  2809.     outputs the height of your window in pixels
  2810.     @winleft( )
  2811.     returns the left edge of your window
  2812.     @winrows( )
  2813.     returns the number of lines in the current shell window
  2814.     @wintop( )
  2815.     returns the top edge of your window
  2816.     @winwidth( )
  2817.     outputs the width of your window in pixels
  2818.     @without( name ... name , name ... name )
  2819.     returns all names of list 1 that are not in list 2
  2820.     @word( name ... name n )
  2821.     picks the n-th word from the list.
  2822.     @words( name ... name )
  2823.     returns the number of words in the list.
  2824.  
  2825.  
  2826. XI. MISCELLANEOUS
  2827. -----------------
  2828.  
  2829.     CShell now allows to do quick scrolling in large windows. Quick
  2830.     scrolling means that whenever the cursor reaches the bottom of
  2831.     the window, the text jumps up 3 or more lines at once. However,
  2832.     only the following commands support this:
  2833.         dir, cat, htype, strings, search, truncate, tee
  2834.     You can choose the number of lines to scroll at once by setting
  2835.     the variable _scroll. Unsetting it or setting it to a value <=1
  2836.     completely disables quick scrolling.
  2837.     You can also choose the number lines a window must at least have
  2838.     to turn on the quick scrolling by setting the _minrows variable.
  2839.     (Defaults to 34). Quick scrolling is automatically disabled when
  2840.     the command is redirected. By piping any command to cat, you can
  2841.     force it to quick scroll. Example:  List | cat
  2842.  
  2843.     CShell now can be terminated using the closing gadget in the
  2844.     AmigaDOS 2.0 shell window. Don't execute c:ENDCLI while using
  2845.     the shell. This can cause problems with external commands. The
  2846.     closing button provides a 'quit' command. You can define
  2847.       alias quit "Endcli;\\quit
  2848.     to assert that the CLI window closes when you click the button.
  2849.  
  2850.  
  2851.     EXCEPTIONS
  2852.     If  no  _except variable exists, any command which fails causes the
  2853.     rest of the line to abort as if an ABORTLINE had been executed.  If
  2854.     the _except variable exists, it is of the form:
  2855.  
  2856.     "nnn;commands..."
  2857.  
  2858.     where  nnn  is  some  value  representing  the  minimum return code
  2859.     required  to  cause  an  error.   Whenever a command returns a code
  2860.     which  is  larger  or  equal  to  nnn,  the commands in _except are
  2861.     executed  before  anything.   WHEN _except EXISTS, THE COMMAND LINE
  2862.     DOES  NOT  ABORT AUTOMATICALLY.  Thus, if you want the current line
  2863.     being executed to be aborted, the last command in _except should be
  2864.     an "abortline".
  2865.  
  2866.     Exception  handling  is  disabled  while  in the exception handling
  2867.     routine (thus you can't get into any infinite loops this way).
  2868.  
  2869.     Thus if _except = ";", return codes are completely ignored.
  2870.  
  2871.     Example:
  2872.  
  2873.     set _except "20;abortline"
  2874.  
  2875.  
  2876. XII. EXAMPLE SOURCE FILES
  2877. -------------------------
  2878.  
  2879. If from a CLI or the startup-script you say 'SHELL filename', that file is
  2880. sourced first.
  2881.  
  2882. ### compat.sh ###
  2883.  
  2884. # this makes sure that your old abbreviations don't call new commands
  2885.  
  2886. alias as  aset
  2887. alias cl  close
  2888. alias g   goto
  2889. alias h   help
  2890. alias he  help
  2891. alias m   md
  2892. alias q   quit
  2893. alias re  rename
  2894. alias w   window
  2895.  
  2896. alias kr  "rm -r ram:* >NIL:
  2897.  
  2898. ### End of compat.sh ###
  2899.  
  2900.  
  2901. Moreover, if you have a file called S:.cshrc, it will be sourced for every
  2902. Shell you run. This is useful for aliases and setting that you want in ALL
  2903. Shells.
  2904.  
  2905.  
  2906. ### Example S:.cshrc ###
  2907.  
  2908. Here is an example .cshrc file:
  2909.  
  2910. set F5 "cdir WORK:"^M
  2911. set f9 "ed s:login.sh"^M
  2912. set F9 "ed df0:s/startup-sequence"^M
  2913.  
  2914. alias toram  "%q foreach i ( $q ) \"cp -r $i: ram:$i >NIL:;assign $i: ram:$i
  2915. alias ramop  "md RAM:op; assign OP: ram:op
  2916. alias noop   "assign OP: ; rm -r ram:op
  2917. alias newop  "rm -r OP:*
  2918. alias dc     "dfc df0: to df1:
  2919. alias go     "%q assign WORK: Boot:$q; cd WORK:; source startme.sh
  2920. alias get    "%q cp $q RAM: >NIL:
  2921. alias filter "%a%b%c exec $b \\<$a \\>$c
  2922.     # reads $a, filters it with $b and writes result to $c
  2923.  
  2924. alias rm     "%q \\rm @confirm( Remove $q )
  2925. # or if you want a more safe one
  2926. alias qrm    "%q \\rm @ask( Remove $q )
  2927.  
  2928. #alias rm     "%a set f @pickargs( $a );set opts @pickargs( $a );\
  2929. # e -n OK to delete @words( @files( $f ) ) file(s) and @words( @dirs( $f ) )\
  2930. # directories\"? \";input b;if $b = y;\\rm $opts $f;endif
  2931. #        # for the anxious among us: confirmed rm
  2932.  
  2933. set _prompt   "%c%p> "
  2934.     # this puts the path highlighted in the prompt
  2935.  
  2936. # this one puts cli number, free mem, date and time in title bar
  2937. set _titlebar "Shell %n    Mem %m     Date %d    Time %t
  2938.  
  2939. # This file will be sourced for every Shell you start
  2940.  
  2941. ### End of example .cshrc ###
  2942.  
  2943. ****************************************************************************
  2944.  
  2945. If you are a CLI user, your startup-sequence may be as simple as:
  2946.  
  2947.     C:csh S:startup.sh
  2948.  
  2949. Here's a startup code:
  2950.  
  2951. ### Example S:startup.sh ###
  2952.  
  2953. wind -l    # if you are on a PAL machine, or use overscan
  2954.     # note that commands may be abbreviated (wind=window)
  2955.  
  2956. assign LC: Stuff:c  INCLUDE: Stuff:include   LIB: Boot:lib   QUAD: RAM:
  2957.  
  2958. rback C:FaccII; sleep 1
  2959.     # after spawning a process, it is always better to allow it
  2960.     # to load the command, to avoid excessive drive head movement
  2961.  
  2962. resident -d blink lc1 lc2 >NIL:    #defer loading
  2963.  
  2964. C:PopCli 300 C:Newcli         #using full pathname loads faster
  2965. C:FF -1 Siesta.font >NIL:
  2966. C:Patch_1 >NIL:
  2967. stack 8000            # lc1 and lc2 need this
  2968.  
  2969. source S:setdate.sh        # this is listed next
  2970.  
  2971. ### End of example startup.sh ###
  2972.  
  2973. ****************************************************************************
  2974.  
  2975. The following is an example source file to set date and time; it may be
  2976. used at startup if you don't have an internal clock.
  2977.  
  2978. ### setdate.sh ###
  2979.  
  2980. open CON:200/100/440/80/SetDate write 1
  2981. echo >.1 -n "Current date is "
  2982. date >.1
  2983. echo >.1 -n "Please enter date: "
  2984. input <.1 d
  2985. close 1
  2986. strlen len $d
  2987. if $len > 1 ; date $d ; endif
  2988. echo -n "New date: " ; date
  2989.  
  2990. ### End of setdate.sh ###
  2991.  
  2992. ***************************************************************************
  2993.  
  2994. Next comes a makefile that needs no Make program: may be executed from
  2995. Shell directly!!!
  2996.  
  2997. ### make.sh ###
  2998.  
  2999. if -t Shell.syms Shell.h; cc +HShell.syms Shell.h; rm shell.o; endif
  3000. if -t RAM:Shell.syms Shell.syms; cp -d Shell.syms RAM:; endif
  3001.  
  3002. foreach i ( main comm1 comm2 comm3 execom globals rawconsole run set \
  3003.  sub ) "if -t $i.o $i.c; echo Compile $i...;cc +IRAM:shell.syms $i.c; endif"
  3004.  
  3005. # we used line continuation for better visibility. this is not necessary,
  3006. # you can type it all in one line. no more limit of 256 bytes per line
  3007.  
  3008. if -t Shell run.o main.o comm1.o comm2.o comm3.o execom.o \
  3009. set.o sub.o globals.o rawconsole.o
  3010.     ln  +q -m -o Shell run.o main.o comm1.o comm2.o comm3.o\
  3011.     execom.o set.o sub.o globals.o rawconsole.o -la -lc
  3012. endif
  3013.  
  3014. ### End of make.sh ###
  3015.  
  3016.  
  3017. XIII.  DEFAULT VALUES
  3018. ---------------------
  3019.  
  3020. Some aliases are predefined whenever you start a new Shell. These are:
  3021.  
  3022.     CDIR
  3023.     Use "cdir directory" to clear the screen, set CD to directory,
  3024.     and list it.
  3025.  
  3026.     CLS
  3027.     Simply clear the screen.
  3028.  
  3029.     DSWAP
  3030.     Exchanges current and the previous current directory. For use in
  3031.     scripts as the symbol for last current directory may change.
  3032.  
  3033.     EXIT
  3034.     Leave Shell and exit CLI.
  3035.  
  3036.     MANLIST
  3037.     Display  a list of possible arguments to man.
  3038.  
  3039.     RX
  3040.     Executes a REXX script. Prevents unwanted starting of 'rxrec'.
  3041.  
  3042. Moreover, many variables have default values, and many function keys are
  3043. predefined. You can use set command to determine all of these.
  3044.  
  3045.  
  3046. XIV.  OBJECT ORIENTED FEATURES
  3047. ------------------------------
  3048.  
  3049. File classes are good for two things: Identifying files and command over-
  3050. loading. The latter means that the same command with files of different
  3051. type performs completely different actions.
  3052.  
  3053.     CLASSES OF FILES
  3054.  
  3055.     You can define a class of files using several 'class' commands.
  3056.     Here a simple example:
  3057.  
  3058.       class picture  suff=.pic suff=.iff suff=.ilbm
  3059.       class anim     suff=.anim
  3060.  
  3061.     From now on, everything with the suffix .pic, .iff or .ilbm will
  3062.     be identified as a picture. Please note that there may be no blanks
  3063.     between the names and the '=', and that blanks inside the names
  3064.     must be put in quotes. So these are the ways to identify a file:
  3065.  
  3066.       suff=.doc        True if the suffix of the file is .doc
  3067.       name=readme      True if the file is "readme"
  3068.       name="mod.*"     True if the name starts with 'mod.'
  3069.       offs=14,DC..C4FD True if the bytes starting at $14 are $DC,
  3070.                        anything, $C4, $FD  (all numbers hexadecimal!).
  3071.                        Each pair of dots means one byte ignored.
  3072.       chars            True if 90% of the bytes in the file are 32..127
  3073.                        or 9..13
  3074.       default          Always true, used to define the default type
  3075.  
  3076.     Note that only the first character is examined, so 's' = 'suff'.
  3077.     One class can be identified by more than one 'class' statement.
  3078.     They are looked at in the same sequence they were entered. So to
  3079.     make sure that an zoo archive misnamed as .lzh is identified
  3080.     correctly, use the following 'class' statements:
  3081.  
  3082.       class zoo offs=14,DCA7C4FD
  3083.       class lzh offs=2,2D6C68..2D
  3084.       class zoo suff=.zoo
  3085.       class lzh suff=.lzh
  3086.  
  3087.     Moreover, there is a builtin class 'dir', which means directory.
  3088.     Now we know many file types. But what to do with them? This is
  3089.     where we define 'actions'.
  3090.  
  3091.     ACTIONS ON CLASSES
  3092.  
  3093.     There may be one or more 'class' commands that define what actions
  3094.     need to be taken in various cases for that specific class:
  3095.  
  3096.       class zoo actions view="zoo -list" extr="zoo -extract"
  3097.       class lzh actions view="lz l"      extr="lz e"
  3098.  
  3099.     Whenever somebody tries to 'view' a test.zoo, the command
  3100.     'zoo -list test.zoo' will be issued, but if he tries to
  3101.     view test.lzh, then 'lz l test.lzh' will be executed. Note
  3102.     that any command supplied here goes through the normal csh
  3103.     parser, so AmigaDOS and csh paths will be searched. Aliases
  3104.     with arguments are allowed here, too, so whatever the user
  3105.     typed will be stored in the variable after the '%'.
  3106.  
  3107.     How do I tell a file that I want to 'view' it? There comes the
  3108.     second command used for object oriented features:
  3109.  
  3110.       action view test.zoo
  3111.  
  3112.     will first identify the type of that file and then apply, if
  3113.     possible, the 'view' action to it. Of course, this works best
  3114.     inside an alias:  alias v "action view" will define a v-command
  3115.     that views all types of files known to cshell. Similarly, you
  3116.     can define   alias xtr "action extr" and use this command to
  3117.     extract files from any type of archive.
  3118.     There is one action that will be sent to every file that you
  3119.     try to start but is not executable. This action is 'exec'.
  3120.     Assume you have defined the class 'picture', then after
  3121.  
  3122.       class picture actions view=Mostra exec=Mostra
  3123.  
  3124.     you can display a picture using Mostra by just typing its name.
  3125.     More builtin actions like 'rm' and 'dir' may be implemented,
  3126.     so don't use command names for action names.
  3127.  
  3128.     The batch file class.sh defines a few useful classes.
  3129.  
  3130.     SUPERCLASSES
  3131.  
  3132.     Assume you have a class for .c files, one for .h files, and
  3133.     one for .asm files. You might want to make the difference
  3134.     between them when identifying them, but in the end, they're
  3135.     all ASCII, aren't they? You can stat this with the command
  3136.  
  3137.       class c_source suff=.c is=ascii
  3138.  
  3139.     Now whenever an action on a file of the type c_source fails,
  3140.     the file is interpreted as of type ascii, and the same
  3141.     action is attemted again. This goes on until a class has no
  3142.     more superclass.
  3143.  
  3144.  
  3145. XV.     KEYMAPS
  3146. ---------------
  3147.  
  3148.     You define a keymap as a collection of key/function pairs. Both
  3149.     are given as numbers. There can be several keymaps which activate
  3150.     each other, but at first we only edit keymap 0, which is active
  3151.     at the beginning. All keys you define will eventually overwrite
  3152.     the old definitions in an existing keymap. Everything marked with
  3153.     a (*) is not yet implemented.
  3154.  
  3155.     KEYCODES
  3156.  
  3157.     1..255    The corresponding ASCII character
  3158.     256      Up Arrow
  3159.     257      Down Arrow
  3160.     258      Right Arrow
  3161.     259      Left Arrow
  3162.     260      Help
  3163.     261..270  F1..F10  (unshifted)
  3164.  
  3165.  
  3166.     Modifiers (add them to the key code)
  3167.  
  3168.     512       SHIFT (only necessary for arrows and fkeys)
  3169.     1024      ESC   (was pressed & released before this key)
  3170.  
  3171.     EDITFUNCTIONS
  3172.  
  3173.     - Movement      Move cursor...
  3174.      0  CursLeft    1 left
  3175.      1  CursRight   1 right
  3176.      2  WordLeft    1 word left
  3177.      3  WordRight   1 word right
  3178.      4  BegOfLine   to beginning of line
  3179.      5  EndOfLine   to end of line
  3180.  
  3181.     - Deleting      Delete...
  3182.     10  Backspace   char left from cursor
  3183.     11  Delete      char right from cursor
  3184.     12  BkspcWord   word left from cursor
  3185.     13  DelWord     word right from cursor
  3186.     14  DeleteToSOL to start of line
  3187.     15  DeleteToEOL to end of line
  3188.     16  DeleteLine  whole line
  3189.     17  DelScreen   whole screen and refresh current line
  3190.  
  3191.     - History insert
  3192.     20  Back        Move one line back in history
  3193.     21  Forward     Move one line forward in history
  3194.     22  Beg         Move to first line in history
  3195.     23  End         Move to last line in history
  3196.     24  Complete    History retrieve like '!'
  3197.     25  Exec        Execute history line & bring up next
  3198.     26  Tail        Insert previous line except first word
  3199.     27  Bottom      Go below last history command
  3200.     28  DupWord     Duplicates the last word on this line
  3201.     29  LastPrev    Insert last word of previous line
  3202.  
  3203.     - Completion
  3204.     30  Normal      Insert first matching file (or cycle)
  3205.     31  Partial     Insert common substring of all matching files
  3206.     32  All         Insert all matching files
  3207.     33  Directory   Find dir in quick cd list
  3208.     34  LastCD      Insert last current directory
  3209.     35  Show        Shows all matching files
  3210.     36  CompPrg1    Insert first matching program (or cycle)
  3211.     37  CompPrgAll  Shows all matching programs
  3212.  
  3213.     - Special
  3214.     40  Insert      Toggle Insert/Overwrite
  3215.     41  Quit        Silently perform 'quit'
  3216.     42  Help        Silently perform 'help'
  3217.     43  Refresh     Redraw current line
  3218.     44  Execute     Execute current line
  3219.     45  Leave       Edit new line, store this in hist
  3220.     46  EOF         Terminate shell
  3221.     47  NOP         Do nothing
  3222.     48  Echo^O      Echoes a ^O
  3223.     49  Beep        Echoes a ^G
  3224.  
  3225.     - Other
  3226.     50  Fkey        Execute command associated to last fkey
  3227.     51  Menu        Execute command associated to last menu
  3228.     52  Undo        Undoes last edit
  3229.     53  Repeat      Repeats last function
  3230.     54  SwapChar    Swaps the two chars left of cursor
  3231.     55  QuoteChar   Quote next char
  3232.  
  3233.  
  3234.     Command types
  3235.  
  3236.     0   +x      Editing function x, see above descriptions
  3237.     512 +x      Setmap x,     x=0..7
  3238.     1024+x      Insert key x, x=1..255
  3239.     1536+x      Macro x       x=1..15         (*)
  3240.     2048+x      String x      x=1..15         (*)
  3241.  
  3242.     Examples:
  3243.  
  3244.     keymap 0    66=49    # the  B key will beep
  3245.     keymap 0     2=16    # ^B key will erase line
  3246.     keymap 0  1122=35    # ESC-b will show matching files
  3247.     keymap 0 9=31 521=30 # Swaps TAB and SHIFT-TAB
  3248.  
  3249.     keymap 0 260=47      # do nothing on help
  3250.     keymap 0 12=17       # clear screen and refresh line on ^L
  3251.     keymap 0 18=29       # insert last word of prev line on ^R
  3252.  
  3253.  
  3254. XVI.    SCROLLING
  3255. -----------------
  3256.  
  3257. console.device
  3258. --------------
  3259.  
  3260. Ever wondered why Commodore's shell scroll a standard ASCII text file
  3261. very fast and why CSH scrolls (despite line-buffering in most commands)
  3262. the same text file at a noticable slower speed?
  3263.  
  3264. Now, first of all it must be said that CSH uses the same console
  3265. environment as Commodore's shell does.  So in fact both shells will
  3266. scroll at the SAME speed -- provided that they're configured in a
  3267. similar way.
  3268.  
  3269. Excerpt from "console" autodoc:
  3270.  
  3271. |     V39 console.device takes advantage of the ability to mask
  3272. |     bitplanes for faster scrolling, clearing, and rendering.
  3273. |     The actual number of bitplanes scrolled depends on which
  3274. |     colors you set via the SGR sequences.  For those using
  3275. |     the defaults of PEN color 1, and cell color 0, console.device
  3276. |     only needs to scroll 1 bitplane.  The actual number
  3277. |     of bitplanes scrolled is reset when ESCc is sent, and when
  3278. |     the console window is entirely cleared (e.g., FF).  In
  3279. |     general this should cause no compatability problems, unless
  3280. |     you are mixing console rendering with graphic.library calls
  3281. |     in the same portions of your window.  Console.device considers
  3282. |     the number of bitplanes it must scroll, and the screen display
  3283. |     depth so that interleaved bitplane scrolling can be taken
  3284. |     advantage of in cases where performance is not significantly
  3285. |     affected (interleaved scrolling, and masking are mutually
  3286. |     exclusive).  The determination of how many planes to scroll
  3287. |     is undefined, and may change in the future.
  3288.  
  3289. In other words:
  3290.  
  3291. After opening a window or sending ANSI sequences that clear the window
  3292. (ESC c, FF) the console.device checks how much bitplanes are in use.
  3293. The number of bitplanes depends on the number of colors used in this
  3294. window.
  3295.  
  3296. If there's only 1 color in use (this is default in Commodore's shell)
  3297. then console.device can perform very fast scrolling because only one
  3298. bitplane needs to be scrolled.
  3299.  
  3300. The scroll speed becomes slower the more colors you use.  Lots of
  3301. programs use at least one additional color by default.  This looks
  3302. nice but slows down scrolling.  Besides others, CSH is one of the
  3303. programs that make use of additional colors.  By default CSH has a
  3304. colored prompt.  And some internal commands like "dir" use a color
  3305. to highlight text.
  3306.  
  3307. With the variable "_hilite" you can control how CSH highlights text.
  3308. If you type "set _hilite b" then text will be highlighted by making
  3309. it bold.  See "man _hilite" for further information.
  3310.  
  3311. If you want really fast text scrolling then avoid using colors in text
  3312. output. For example, add "set _hilite b" in your "s:.cshrc" file.  And
  3313. configure other programs (like NewList, a very cool directory lister
  3314. by Phil Dietz) so that they don't use colored output.
  3315.  
  3316. If you have to use colored text (for any reason) then clear the window
  3317. as soon as possible to allow the console.device to re-enable fast text
  3318. scrolling.
  3319.  
  3320. ALWAYS REMEMBER:
  3321.  
  3322. To enable fast scrolling you must clear the screen (ESC c, FF) first.
  3323.  
  3324. As soon as you use more than one color in your text output,
  3325. console.device switches back to normal (slow) scrolling automatically.
  3326. Then you have to clear the screen manually to re-activate optimized
  3327. (fast) scrolling.
  3328.  
  3329.  
  3330. CpuBlit
  3331. -------
  3332.  
  3333. You're running CpuBlit and you wonder why under Kickstart 2.x text
  3334. scrolls faster than under Kickstart 3.x.
  3335.  
  3336. Check if you call CpuBlit with option "-b". This option MUST be set
  3337. to allow CpuBlit the handling of (so called) "broken" bitmaps.
  3338.  
  3339.